Don't allow unlocking the wrong revision.

Discovered that error handling in the client code could potentially try
and unlock the wrong revision.