urlparse returns brackets of IPv6 address

Fixes https://github.com/kennethreitz/requests/issues/1426#issuecomment-19649944

Code is kept close to the original, so it still throws a ValueError, if the
closing bracket is missing.
Using slices would have changed the behaviour.