Improve session handling

- force conversion of lazy objects to unicode string
- delete cache keys which are not dictionaries

Signed-off-by: Michal Čihař <michal@cihar.com>