Fixing memory leaks while using websockets.

Memory leaks have manifested due to the request, socket and other objects kept around after a client disconnects from a websockets connection. This resolves that issue by removing references so they can be garbage collected.