Fix exception caused by race condition
Fix exception caused by race condition

If a peer disconnects, but the handshake they already sent hasn't been
processed by the wire yet (rare!) then onHandshake could be called
after the peer is destroyed.

At this point self.wire is `null`, so that will get pushed into the
self.swarm.wires array and cause this issue:
https://github.com/feross/webtorrent/issues/792

Closes #792.

yciabaud/webtorrent,jamesliu96/webtorrent,webtorrent/webtorrent,feross/webtorrent,joshterrill/webtorrent,jamesliu96/webtorrent,yciabaud/webtorrent,joshterrill/webtorrent,feross/webtorrent,webtorrent/webtorrent