Avoid "b'string'" in url_join() on py3k

To allow joining args of different types, url_join() uses '%s' % arg
to format the arguments; while in Python 2 this works, in Python 3
bytearray and bytes arguments are formatted as /bytearray(b'abc')/
and /b'arg'/ rather than /arg/, so more sophisticated code is needed.

Mixing Unicode and byte data is risky as you don't know the encoding
of the bytes arguments, but as long as args are ASCII (or non-ASCII
Unicode data) it is okay.  We can even allow non-ASCII bytes in the
base URL if we specify that the returned joined URL has the same type
(Unicode or bytes) and in the latter case, encoding, as the base URL.

To allow a base URL to have non-ASCII bytes, we have to play encoding
tricks on urlsplit and urlunsplit, "decoding" bytes as latin1 before
passing the resulting "Unicode" to the function, and then re-encoding
the result(s) as latin1 to reverse the transformation.

A TypeError is raised if a non-ASCII bytes argument is passed, or a
non-ASCII Unicode argument is passed with a bytes base URL.  This is
by analogy with posixpath.join(), which doesn't care about or check
for non-ASCII, but rejects mixed strings and bytes with a TypeError.
Really test joining encoded unicode

And test joining mixed encoded and decoded unicode as well, actually
passing bytes and bytearray arguments for encoded unicode strings.

And test that non-ASCII args requiring conversion, or non-ASCII bytes
args, raise a TypeError.