Improve redis repository implementations

Storing values in zset makes them less prone to races.

Fixes gh-929