Single thread Mir event handling

Move over to using an internal event queue for all Mir events. This way we can actually poll for events from the main thread.

Fixed a few crashes in the monitor code.