fixes for libevent 1.4