Implements a locking primitive using redis