Python 3: fix tests on HTTP headers

HTTP headers are encoded to bytes. Store headers at (key, value) tuples instead
of Unicode strings.

Check also that non-ASCII Unicode headers are encoded to UTF-8.

Change-Id: Ie45f5a5ba63f539a723a7ac5649779d8efb3e912
Merge "Python 3: fix tests on HTTP headers"