Add additional check for an open socket before writing

In many cases, the socket will already be closed by the time
#closeStream is called. This adds an additional check that the socket
exists before checking if it is writable.
Version bump to 0.0.10