Synchronize accesses to the LiveListenerBus' event queue

This guards against the race condition in which we (1) dequeue an event,
and (2) check for queue emptiness before (3) actually processing the
event in all attached listeners.

The solution is to make steps (1) and (3) atomic relatively to (2).