A simple gen_event backend used to monitor mailbox size and
switch log messages between synchronous and asynchronous modes.
A gen_event handler is used because a process getting its own mailbox
size doesn't involve getting a lock, and gen_event handlers run in their
parent's process.