Use main runloop for mouse event listener

This commit simplifies the mouse event listener. It no longer
creates it's own thread for handling mouse events, but just adds
and removes a runloop source.