Ensure write_loop ends; pass message via write_queue
Ensure write_loop ends; pass message via write_queue

There is a race condition with the current implementation where by
setting `@stop_write_loop = true` can potentially not be seen by the
Thread running `the write_loop`. Even with a Mutex around the variable
@stop_write_loop, there is a chance that the `.join(1)` will enter the
loop and imediately call `@write_queue.pop`. If there is nothing in the
queue at the time pop is called, the thread will block waiting for new
data. In the case that we are `close`ing the current connection, this
thread will be left for garbage collection at some later date...

The change here removes that variable `@stop_write_loop` and instead,
pushes a symbol :stop_write_loop onto the write_queue for the write_loop
to see and then act on.

wistia/nsq-ruby