fix redis Locking idiom and added tests

the problem was: the lua script uses KEYS, but those were not given in the call to the script