a Lock implementation for Google App Engine applications, which uses the Memcache service to ensure global locking (i.e. among
all the instances of the application). The lock is re-entrant (i.e. can be locked and then re-locked in a nested method by the same
thread) and minimizes the amount of calls to the Memcache service by having all threads from a single instance share the Memcache
polling loop.

Locking with Memcache is not a bullet-proof solution, as unexpected eviction of the cache may result in a situation where one instance
acquires a lock that is in fact taken by another. However, the risk is very minimal especially if using the Dedicated Plan from Google
(see here). Also, a lock entry in Memcache is very unlikely
to be evicted due to LRU considerations, as locks are either short-lived or very frequently updated (in high contention).

this method blocks execution until it acquires the global lock (or gets interrupted). it does so using an infinite loop which checks
a shared Memcache entry once in every short-while, until it succeeds in acquiring the lock