server: Improve handling of disconnected peers.
server: Improve handling of disconnected peers.

When the peer code was refactored, the lists of peers were converted to
maps however the code which runs when a peer disconnects still iterates
them like a slice.  This is no longer necessary since they are maps
which means the peer can simply be looked up by its ID.

Also, the old code was comparing the map entry and the peer being
removed by their pointers which could lead to potentially not properly
finding the peer.  This issue is also resolved by this change since it
looks up the peer by its ID.

Stash-Crypto/btcd,ppcsuite/ppcd,btcsuite/btcd,wallclockbuilder/btcd,aakselrod/btcd,soapboxsys/ombfullnode,jcmincke/dcrd,jrick/btcd,decred/dcrd,aakselrod/btcd,jrick/btcd,hectorj/btcd,tb00/btcd,hectorj/btcd,dan-da/btcd,stevenroose/btcd,dajohi/btcd,jrick/dcrd,cqswxj2013/btcd,soapboxsys/ombfullnode,jongillham/btcd,adiabat/btcd,decred/dcrd,jongillham/btcd,ltcsuite/ltcd,tb00/btcd,BitGo/prova,wallclockbuilder/btcd,jcmincke/dcrd,cqswxj2013/btcd,jrick/btcd,davecgh/btcd,btcsuite/btcd,dajohi/btcd,adiabat/btcd,Roasbeef/btcd,BitGo/prova,jrick/dcrd,Stash-Crypto/btcd,ltcsuite/ltcd,Roasbeef/btcd,jcmincke/dcrd,dan-da/btcd,ppcsuite/ppcd,dajohi/btcd,stevenroose/btcd,davecgh/btcd