fix: encode keys before caching

This patch addresses an error in the caching layer that prevented it
from playing nice with backends like memcached that expect keys to be
bytestrings rather than unicode strings. The change is made in
oslo.cache to make its use as transparent as possible to users.

Change-Id: Iee48e16393321ff7908807a9f0f7fa20480ec5f4
Closes-Bug: 1230556
Merge "fix: encode keys before caching"