Added mutex and queuing to push events from work thread into main thread
so that the event callback methods can be invoked from the main thread, thus
enabling operations with non thread-safe methods.