Limited number of messages on outgoing queue

Network handle doWrite now blocks until there are less than 1000 outgoing messages queued up.
Previously, unlimited messages would be added to the queue, consuming all of the machines RAM, and causing bad_allocs()