fix for libevent synchronization