Add add_realtime_event() to allow execute in main thread.

Add check for libevent_pthreads library.