Get rid of an explicit setting AF_INET to socket as

IPv6 is coming. So give a chance to establish connection via IPv6.
Merge pull request #2380 from noxiouz/fix_dual_ip_stack

Give a chance to establish connection via IPv6. Fixes #2380.