Fix SEGFAULT when trying to connect to IPv6 peer in non-IPv6 environment