Handle disconnect during handshake, fix #192