Don't broadcast messages to terminated WebSockets
Don't broadcast messages to terminated WebSockets

If a message is broadcasted through the CherryPy bus in the time interval
between a WebSocket is closed and it is cleaned out of WebSocketPlugin.pool, it
will cause and error in WebSocket.send:

    Traceback (most recent call last):
      File ".../ws4py/server/cherrypyserver.py", line 349, in broadcast
        ws_handler.send(message, binary)
      File ".../ws4py/websocket.py", line 167, in send
        message_sender = self.stream.binary_message if binary else
    self.stream.text_message
    AttributeError: 'NoneType' object has no attribute 'text_message'

This patch checks if each WebSocket handler is terminated or not before trying
to send the broadcasted message, avoiding the above error.

xuhdev/WebSocket-for-Python,quatanium/WebSocket-for-Python,hzruandd/WebSocket-for-Python,uchuugaka/WebSocket-for-Python,quatanium/WebSocket-for-Python,uchuugaka/WebSocket-for-Python,EternityForest/WebSocket-for-Python,quatanium/WebSocket-for-Python,uchuugaka/WebSocket-for-Python,OptimalBPM/WebSocket-for-Python,zhangwei900808/WebSocket-for-Python,EternityForest/WebSocket-for-Python,hzruandd/WebSocket-for-Python,zhangwei900808/WebSocket-for-Python,EternityForest/WebSocket-for-Python,hzruandd/WebSocket-for-Python,OptimalBPM/WebSocket-for-Python,zhangwei900808/WebSocket-for-Python,xuhdev/WebSocket-for-Python,OptimalBPM/WebSocket-for-Python,xuhdev/WebSocket-for-Python