Catch IOErrors (plus dependency tweaks)

As noted in the relevant commit, I get an IOError when a socket is closed (but oddly, only with MRI 1.8), as it's trying to receive data when the underlying websocket is closed. This deals with that issue a little more elegantly.

If you feel there's a better way to handle this, do let me know.