Make sure headers are of str type, not unicode

http://www.python.org/dev/peps/pep-3333/#unicode-issues