Backport ipv6 literal support from Ruby 1.9.3