Use six.moves.urllib.parse for py2/3 compat

Instead of try/except blocks, just use the six module which is already
in use in other places.

Also remove a Python 2.5 compat construct. Python 2.5 is no longer supported.

Change-Id: Idb13d861b0f8c567d1e44ce5bf6c60da12a24d18