pool: Improve selection of listening address

The FTP mover uses logic that can select a local address that
likely is reachable from a given client address.

To do this, dCache uses a trick that will determine which
network interface the host would use to reach the client address.
It it is a good bet (although not a guarantee) that the client
is able to reach us on the same interface.

The code suffers from a flaw in what it does when the trick
fails. There are several cases when this may happen, such as
when the client address is an IPv6 address and the local
host doesn't have an IPv6 stack. The previous logic would
fall back to using the address to which the host name resolves.
This is fragile as we often observes that hosts do not resolve
their name to the external interface. We can do significantly
better by iterating over local interfaces and their addresses
and choose an address from the same protocol family and with
a suitable address scope.

The same improvement can be applied to a variant of this algorithm
that ignores the protocol family. Such a change is left to another
patch.

Target: trunk
Require-notes: yes
Require-book: yes
Acked-by: Paul Millar <paul.millar@desy.de>
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: https://rb.dcache.org/r/7598/