Isolate libevent usage to a few locations

With legacy/trac#21841 (moved), we restricted openssl header usage to a small number of modules. We should do the same with libevent.