set websocket connection to not opened on onclose or onerror callback so
that no send method will use the websocket connection any more