new utils.lock module for creating locks while handling stale locks