make the bot wait for an empty queue before re-exec

This will make the bot empty the message queue and send all the messages
before re-executing itself. If this is not done the bot will loose all
the messages in the queue.
Merge pull request #5 from relekang/safe-re-exec

make the bot wait for an empty queue before re-exec