Fix threading initialization of libevent.