Emit the CloseEvent object on connection close.

Fixes #130: as specified in [The WebSocket API](http://www.w3.org/TR/websockets/#closeWebSocket) when *the WebSocket connection is closed* an event that uses the [CloseEvent](http://www.w3.org/TR/websockets/#closeevent) interface has to be created.