[net] Don't try to take cs_inventory before deleting CNode
[net] Don't try to take cs_inventory before deleting CNode

The TRY_LOCK(cs_inventory) in DisconnectNodes() is taken after the CNode
object has been removed from vNodes and when the CNode's nRefCount is
zero.

The only other places that cs_inventory can be taken are:

- In ProcessMessages() or SendMessages(), when the CNode's nRefCount
must be >0 (see ThreadMessageHandler(), where the refcount is
incremented before calling ProcessMessages() and SendMessages()).
- In a ForEachNode() lambda in PeerLogicValidation::UpdatedBlockTip().
ForEachNode() locks cs_vNodes and calls the function on the CNode
objects in vNodes.

Therefore, cs_inventory is never locked by another thread when the
TRY_LOCK(cs_inventory) is reached in DisconnectNodes(). Since the
only purpose of this TRY_LOCK is to ensure that the lock is not
taken by another thread, this always succeeds. Remove the check.

ElementsProject/elements,kallewoof/bitcoin,domob1812/namecore,practicalswift/bitcoin,dscotese/bitcoin,pstratem/bitcoin,practicalswift/bitcoin,alecalve/bitcoin,dscotese/bitcoin,mruddy/bitcoin,pataquets/namecoin-core,achow101/bitcoin,pstratem/bitcoin,domob1812/bitcoin,lateminer/bitcoin,jlopp/statoshi,n1bor/bitcoin,mm-s/bitcoin,jamesob/bitcoin,JeremyRubin/bitcoin,domob1812/bitcoin,jnewbery/bitcoin,JeremyRubin/bitcoin,andreaskern/bitcoin,domob1812/bitcoin,jonasschnelli/bitcoin,MeshCollider/bitcoin,yenliangl/bitcoin,namecoin/namecore,anditto/bitcoin,ElementsProject/elements,GroestlCoin/bitcoin,EthanHeilman/bitcoin,jambolo/bitcoin,rnicoll/dogecoin,prusnak/bitcoin,rnicoll/dogecoin,bitcoinknots/bitcoin,GroestlCoin/bitcoin,sipsorcery/bitcoin,Sjors/bitcoin,namecoin/namecore,qtumproject/qtum,ajtowns/bitcoin,pataquets/namecoin-core,namecoin/namecoin-core,MeshCollider/bitcoin,litecoin-project/litecoin,mm-s/bitcoin,apoelstra/bitcoin,Xekyo/bitcoin,bitcoin/bitcoin,jambolo/bitcoin,andreaskern/bitcoin,lateminer/bitcoin,namecoin/namecoin-core,yenliangl/bitcoin,bitcoinknots/bitcoin,fujicoin/fujicoin,MeshCollider/bitcoin,fujicoin/fujicoin,particl/particl-core,fanquake/bitcoin,jlopp/statoshi,cdecker/bitcoin,jonasschnelli/bitcoin,mruddy/bitcoin,cdecker/bitcoin,sipsorcery/bitcoin,Sjors/bitcoin,fanquake/bitcoin,pstratem/bitcoin,kallewoof/bitcoin,achow101/bitcoin,litecoin-project/litecoin,andreaskern/bitcoin,ElementsProject/elements,fanquake/bitcoin,domob1812/bitcoin,pataquets/namecoin-core,domob1812/namecore,alecalve/bitcoin,achow101/bitcoin,EthanHeilman/bitcoin,GroestlCoin/bitcoin,AkioNak/bitcoin,namecoin/namecore,Xekyo/bitcoin,qtumproject/qtum,alecalve/bitcoin,sipsorcery/bitcoin,apoelstra/bitcoin,anditto/bitcoin,bitcoin/bitcoin,Xekyo/bitcoin,rnicoll/bitcoin,instagibbs/bitcoin,qtumproject/qtum,n1bor/bitcoin,anditto/bitcoin,MarcoFalke/bitcoin,EthanHeilman/bitcoin,instagibbs/bitcoin,EthanHeilman/bitcoin,n1bor/bitcoin,anditto/bitcoin,MarcoFalke/bitcoin,qtumproject/qtum,Xekyo/bitcoin,ElementsProject/elements,rnicoll/bitcoin,AkioNak/bitcoin,pstratem/bitcoin,qtumproject/qtum,andreaskern/bitcoin,qtumproject/qtum,GroestlCoin/GroestlCoin,namecoin/namecore,sstone/bitcoin,litecoin-project/litecoin,namecoin/namecoin-core,domob1812/namecore,sstone/bitcoin,domob1812/namecore,pstratem/bitcoin,namecoin/namecore,JeremyRubin/bitcoin,bitcoinsSG/bitcoin,domob1812/namecore,jonasschnelli/bitcoin,bitcoinsSG/bitcoin,prusnak/bitcoin,practicalswift/bitcoin,mruddy/bitcoin,mruddy/bitcoin,GroestlCoin/GroestlCoin,litecoin-project/litecoin,pataquets/namecoin-core,tecnovert/particl-core,lateminer/bitcoin,GroestlCoin/bitcoin,Sjors/bitcoin,JeremyRubin/bitcoin,AkioNak/bitcoin,yenliangl/bitcoin,jlopp/statoshi,particl/particl-core,fujicoin/fujicoin,instagibbs/bitcoin,MeshCollider/bitcoin,bitcoinsSG/bitcoin,practicalswift/bitcoin,anditto/bitcoin,sstone/bitcoin,instagibbs/bitcoin,jambolo/bitcoin,mm-s/bitcoin,sipsorcery/bitcoin,jambolo/bitcoin,particl/particl-core,instagibbs/bitcoin,ajtowns/bitcoin,tecnovert/particl-core,prusnak/bitcoin,achow101/bitcoin,tecnovert/particl-core,n1bor/bitcoin,achow101/bitcoin,kallewoof/bitcoin,GroestlCoin/bitcoin,jlopp/statoshi,jonasschnelli/bitcoin,MeshCollider/bitcoin,MarcoFalke/bitcoin,JeremyRubin/bitcoin,cdecker/bitcoin,particl/particl-core,bitcoin/bitcoin,tecnovert/particl-core,GroestlCoin/GroestlCoin,rnicoll/bitcoin,EthanHeilman/bitcoin,n1bor/bitcoin,domob1812/bitcoin,prusnak/bitcoin,jamesob/bitcoin,rnicoll/dogecoin,ajtowns/bitcoin,sstone/bitcoin,GroestlCoin/GroestlCoin,mm-s/bitcoin,alecalve/bitcoin,rnicoll/bitcoin,instagibbs/bitcoin,bitcoin/bitcoin,anditto/bitcoin,pataquets/namecoin-core,fujicoin/fujicoin,cdecker/bitcoin,dscotese/bitcoin,MarcoFalke/bitcoin,ajtowns/bitcoin,andreaskern/bitcoin,ajtowns/bitcoin,AkioNak/bitcoin,pataquets/namecoin-core,bitcoinknots/bitcoin,fanquake/bitcoin,jamesob/bitcoin,fujicoin/fujicoin,fanquake/bitcoin,rnicoll/dogecoin,litecoin-project/litecoin,bitcoinknots/bitcoin,ajtowns/bitcoin,MeshCollider/bitcoin,andreaskern/bitcoin,bitcoinsSG/bitcoin,bitcoin/bitcoin,dscotese/bitcoin,fanquake/bitcoin,rnicoll/dogecoin,dscotese/bitcoin,prusnak/bitcoin,yenliangl/bitcoin,alecalve/bitcoin,apoelstra/bitcoin,sstone/bitcoin,tecnovert/particl-core,GroestlCoin/GroestlCoin,mruddy/bitcoin,bitcoin/bitcoin,particl/particl-core,AkioNak/bitcoin,jonasschnelli/bitcoin,jnewbery/bitcoin,mm-s/bitcoin,apoelstra/bitcoin,cdecker/bitcoin,EthanHeilman/bitcoin,particl/particl-core,namecoin/namecoin-core,qtumproject/qtum,jlopp/statoshi,jamesob/bitcoin,litecoin-project/litecoin,alecalve/bitcoin,bitcoinsSG/bitcoin,Sjors/bitcoin,ElementsProject/elements,yenliangl/bitcoin,kallewoof/bitcoin,practicalswift/bitcoin,achow101/bitcoin,MarcoFalke/bitcoin,jnewbery/bitcoin,GroestlCoin/GroestlCoin,sipsorcery/bitcoin,jambolo/bitcoin,mruddy/bitcoin,lateminer/bitcoin,dscotese/bitcoin,bitcoinknots/bitcoin,kallewoof/bitcoin,Xekyo/bitcoin,jamesob/bitcoin,jamesob/bitcoin,mm-s/bitcoin,domob1812/bitcoin,bitcoinsSG/bitcoin,pstratem/bitcoin,jnewbery/bitcoin,prusnak/bitcoin,lateminer/bitcoin,MarcoFalke/bitcoin,namecoin/namecoin-core,apoelstra/bitcoin,lateminer/bitcoin,ElementsProject/elements,apoelstra/bitcoin,domob1812/namecore,jambolo/bitcoin,jnewbery/bitcoin,n1bor/bitcoin,kallewoof/bitcoin,Xekyo/bitcoin,rnicoll/bitcoin,practicalswift/bitcoin,yenliangl/bitcoin,Sjors/bitcoin,sipsorcery/bitcoin,JeremyRubin/bitcoin,GroestlCoin/bitcoin,namecoin/namecore,fujicoin/fujicoin,AkioNak/bitcoin,sstone/bitcoin,tecnovert/particl-core,namecoin/namecoin-core,rnicoll/bitcoin,cdecker/bitcoin,jlopp/statoshi