network: fix detection of ipv6 availability

fix ipv4 fallback method introduced here: c5dccafff423b30904a97fe1013ed6b4f1180fe9
Until you bind a socket you don't know whether ipv6 is supported or not.