fix backtrace printed when cannot get lock.
change lock error handling code so exceptions have useful info and
exception handling in one place.
add test case for when cannot get lock.
%%% should show a removed and b added
A b
R a
reverting...
%%% should show b unknown and a back to normal
? b
merging a
%%% should show foo-b
foo-b
%%% should show a removed and b added
A b
R a
reverting...
%%% should show b unknown and a marked modified (merged)
? b
%%% should show foo-b
foo-b