Fixed IPv6 parsing

I fixed a bug that caused the last part of an IPv6 address to be parsed as the port number when the last part is all numeric.  I did this in response to [this comment](https://github.com/joyent/node/pull/5435#issuecomment-17636816) on a node.js pull request.