Support auth when headers contains bytes

This fixes #2520 by checking whether headers are `bytes` and decoding
them before performing string operations. It adds a new test covering
this functionality which now passes on all supported Python versions.

cc @jamesls, @kyleknap