net: check for invalid socket earlier in CConnman::AcceptConnection()
net: check for invalid socket earlier in CConnman::AcceptConnection()

This check is related to an `accept()` failure. So do the check earlier,
closer to the `accept()` call.

This will allow to isolate the `accept()`-specific code at the beginning
of `CConnman::AcceptConnection()` and reuse the code that follows it.

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