locks: make change lock state the last operation.