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.
Merge pull request #2521 from danielgtaylor/header-bytes

Support auth when headers contains bytes. Fixes #2521, #2520.