Added watchdog to safely monitor message queue on shutdown. Fixed a race condition in shutdown. Got rid of awaitShutdown() method. Improved logging of shutdown.