Guard against socket.gets being nil

In the situation where the socket has only one line to respond with, any
following gets to the socket need to take care to not assume there is a
non-nil response.
Merge pull request #112 from daisybill/master

Guard against nil socket.gets responses