Fix websocket test to wait for listen to complete