tests: port test-url.py to Python 3
# skip-blame it's all b prefixes and pycompat.bytestr() wrappers
Differential Revision: https://phab.mercurial-scm.org/D3470
tests: fix error case in test-url.py's doctest
This required some careful attention, so I wanted to split it out from
the uninteresting bits that'll be in the next change.
Differential Revision: https://phab.mercurial-scm.org/D3469