redis: use ref of key in slots; fix memory leak