Fix scan: the cursor is returned as a long in redis-py.

This caused hangs when testing with --use-redis .