Context mgmt for lock