When write is called while connecting, wait for connection