more locking stuff

 * lock parameter to cache_do can be 'true' or an integer which indicates
   the lock timeout
 * retrieve object from redis and check if it's locked in one redis
   operation instead of two