Log when locks expire before they can be released

The purpose of these changes is to verify that a situation is not occurring.
Currently, a situation could theoretically arise where a lock expires for
one thread, a new thread gets a new lock on the same key, and the old thread
then completes. The out of order deletion of the lock would cause a cascade
effect, and the lock would then be entirely ineffective for all threads
until there is no contention on the lock anymore for the expiration period.
Presently, if this situation occurs it does so silently since no error would be
thrown.
lock.py: Add random delay between lock retries.

This should reduce memcached spam and burst requests when locks are highly contended.
lock.py: Made lock exception check for success

In certain cases, memcached add will except even though it actually
succeeds. This would cause a lock to wait forever, or timeout.