Added mechanism for dealing with failure to release lock during locked operation