Added a self.lock wrapper to hold distributed Redis-based locks