Pull Request: block on dealloc until all work queue tasks are finished
Pull Request: Fix: memory leak and lack of actually closing the WebSocket.