Use 127.0.0.1 as default TestContext host instead of external IP
Instead of getting an external host IP, use the loopback IP. The loopback IP may have failed with events many years ago, but it works now (see comment here).
An added benefit is that the operating system firewall warnings (at least on macOS) don't pop up for each test when we only listen on the loopback address.
We keep using an external IP by default if running DeviceTestContext from command line.
In this case, the user may depend on the same
default behaviour of selecting an externally accessible IP.
If they don't want such an IP, then it is trivial to specify
--host 127.0.0.1
(specifying the external IP would be more
difficult from the command line).
Note: "localhost"
doesn't work, possibly because omniORB is creating an
IPv6 socket in this case.