Fix ipv6 support for http. When URL contain domain, not IP address.

Before this patch socket created before domain was resolved, and it
always create with AF_INET (ipv4), but we must create socket only after
domain was resolved to understad which protocol family have domain
address.

Thank to Patrick Pelletier, who found this bug.
Add regress test ipv6_for_domain.

Written for commit 71e709c7829275a594f767b27468b1b52e8b5bb9.
Fix ipv6 support for http. When URL contain domain, not IP address.
Merge pull request #39 from azat/fix-http-for-ipv6

Fix ipv6 support for http. When URL contain domain, not IP address.