Fix bug with dispatcher waitgroup.

- Add additional logic to respect Server state more.
- Add write-to-server methods for Bot and Server.