DevTools Bridge shutdown on socket close

Fixed the standalone DevTools Bridge to properly shut down when its WebSocket connection closes, with protection against re-entrance issues. Added tests to verify the Bridge shuts down cleanly on socket closure.