Use channel to synchronize websocket writes