Set websocket variable to null, so that it will not be possible to send data to it once closed.