Prefer IPv6 connections if available

This should work with IPv4-only too, but I haven't extensively tested
that.