Cast environment variable key to bytes for Python 2 as well