Add a minimal implementation of ClientUseIPv4 so IPv6-only clients can bootstrap
When Tor bootstraps, it connects to directory servers on their IPv4 address, regardless of the ClientUseIPv6 option.
We can add a ClientUseIPv4 option, and set it to 1 by default. (This needs a config check: reject the config if ClientUseIPv4 and ClientUseIPv6 are both 0.)
Then we can add connection_get_address_family_for_purpose(), which returns the address family that should be used by outgoing connections. In this minimal implementation, we'll return AF_INET, unless ClientUseIPv4 is 0 and ClientUseIPv6 is 1 (an IPv6-only client).
For the moment, we'll ignore ClientPreferIPv6ORPort in connection_address_family_for_purpose. Once IPv6-only clients can bootstrap, we'll find out if the existing implementation of ClientPreferIPv6ORPort works.
This will implement parts of legacy/trac#9068 (moved), but only the minimal functionality needed to decide whether we are allowed to connect via IPv4 or IPv6. (There are many clever things we could do on dual-stack clients in connection_address_family_for_purpose(), to guess which IP version to use, or to alternate IP versions to find the best one. Some of these designs are described in legacy/trac#9068 (moved) and legacy/trac#17834 (moved). But first we need to get IPv6-using and IPv6-only clients bootstrapping.)