avoid deadlock on bounded queue

If the queue is full, send_command would block, holding the write lock.
This means the event loop could block on getting the flags.
Now we assume the connection is reading/writing.
Because that is what the flags would be after the lock.