Update to use timeouts in the message queue

Instead of using time.sleep when the message queue is empty, let
Queue.get time out by itself.