Bugfix: Cancel a pending lock when Lock.release() is called

If a lock was not yet acquired, calling release() does nothing --
the lock will continue to try to acquire itself in the background. Call
cancel() first to make sure that it gives up trying to get the lock.

Change-Id: I534fafdbc76ae70a18517ff67659a0067405a51c