core: only send a websocket ping if readyState is 1 (connected)