fix over-eager history transitions
close websocket connection when transitioning to a page without websockets