(LockIntermittentFailure) Fix intermittent test failure in locking

This fixes an issue with intermittent test failures. When a lock is attempted to be acquired, the following happens:

1. Get the lock by key, if it doesn't exist, acquire the lock and you are finished
2. If it did exist, check if it has a ttl
3. If it doesn't have a ttl (the result of `ttl` is `-1`), apply a `ttl` using `setex` which also sets a key. This is done in case a process created the lock and crashed before it was able to apply the `ttl` causing a deadlock

If a lock is released after step 1 but before step 2, the check for the `ttl` will result in a `-1`, which will cause the process to reset a lock that was already released. This results in the lock being set and never released until it expires.

This fix puts step 1 and 2 within the same Redis transaction which ensures that it will not be impacted by a race condition.