When running in an ipv6-only environment where AF_INET sockets are not available, many lldb tests (mostly gdb remote tests) fail because things like 127.0.0.1 don't work there.
This change does not use localhost because that may cause slowdown due to slow dns lookups depending on the user's configuration. Instead, try 127.0.0.1 and fallback to ::1 if that doesn't work. For sockets, create an AF_INET socket first and create an AF_INET6 if that doesn't work.
Nit: I believe the std::make_error_code call is redundant (direct comparison to the enum should work fine).