This diff uses the facilities introduced in D5339.
It allows for checking the minimum version on a best effort basis: it
requires to run a libevent function so is not practical when cross
compiling.
It also separates the targets for libevent and libevent_pthreads,
and improves the messages.
Depends on D5339.