prevent race condition when handling expired locks

Fixes a race condition when multiple clients detect an expired lock and are trying to release it.

See "Handling deadlocks" here: http://redis.io/commands/setnx.