Add is_locked flag to ::Lock to make unlock idempotent