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.
net: get the bind address earlier in CConnman::AcceptConnection()
Call GetBindAddress() earlier in CConnman::AcceptConnection(). That
is specific to the TCP protocol and makes the code below it reusable for
other protocols, if the caller provides addr_bind, retrieved by other
means.
This is a backport of core#20685 [4&5/20]
Depends on D11013