producer: fix write error deadlock

see commit message, fixes bitly/nsq#408