Resolve hosts with getaddrinfo so hosts-file IPv6 entries are found
Guard::resolve() combined gethostbynamel(), which is IPv4 only, with a
DNS AAAA query, which skips the hosts file. IPv6 addresses from the
hosts file, such as ::1 for localhost, were never found, so safe mode
couldn't reach a server listening only on them. Use getaddrinfo via
socket_addrinfo_lookup() when ext-sockets is available, falling back to
the previous lookups otherwise.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>