Fix Unicode/bytes handling for Basic Auth in Py3

Looks like I missed this one when porting to Python 3 as there weren't any tests for basic auth.

I've added some tests and the very minor change required to get it to work in Python 3 (still OK on 2.6 and 2.7).