event_loop: fix thread-safety of process_events(false)

@events is accessed unlocked (that's the whole point of having
a Queue in the first place), so swapping the instance variable
is obviously not thread safe.

Revert back to the original counter-based scheme