already been destroyed.
If there was an error establishing a WebSocket connection at an `await` point
and after the point at which the `onerror` etc callbacks had been set but before
the `WsStream` had been constructed then the `onerror` callback would try to be
called but it would have already been destroyed because of the future being
cancelled.
This could happen if, for example, the initial attempt to connect to a WebSocket
server timed out and we never observed an event at this `await` point:
```rust
let mut evts = pharos.observe( Self::OPEN_CLOSE.into() ).await
```
To fix this we introduce a guard that is only active across the `await` points
in the `WsMeta::connect` function. It is temporarily responsible for
unregistering the callbacks in the case that the future is cancelled before the
`WsStream` is constructed.
The error that you'd otherwise run into would present itself like this in the
logs:
```
ERROR: Error: closure invoked recursively or destroyed already
at imports.wbg.__wbindgen_throw (http://localhost:61367/package/web/ditto.es6.js:1:70261)
at wasm_bindgen::throw_str::hf6afd94675c6db0f (http://localhost:61367/package/web/ditto.wasm:wasm-function[119306]:0x3327743)
at <dyn core::ops::function::FnMut<()>+Output = R as wasm_bindgen::closure::WasmClosure>::describe::invoke::h2944e7516b507b14 (http://localhost:61367/package/web/ditto.wasm:wasm-function[49343]:0x2c601d8)
at __wbg_adapter_36 (http://localhost:61367/package/web/ditto.es6.js:1:12851)
at WebSocket.real (http://localhost:61367/package/web/ditto.es6.js:1:11649)
```
Co-Authored-By: Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>