Fix crash when sending data to closed websocket. (#500)
Fix crash when sending data to closed websocket. (#500)

I hit a case where a websocket error event was thrown without a
subsequent close event. Handle that.

moziot/gateway,moziot/gateway,mozilla-iot/gateway,mozilla-iot/gateway,moziot/gateway,mozilla-iot/gateway,mozilla-iot/gateway,mozilla-iot/gateway