WindowSocket: Ensure "onopen" get triggered before dequeuing messages.