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.
1:f248da0d4c3e
0:9eca13a34789
f248da0d4c3e tip
9eca13a34789
9eca13a34789+
9eca13a34789
f248da0d4c3e tip
merge: warning: conflicts during merge
merging file1
merging file1 failed!
diff -r f248da0d4c3e file1
--- a/file1
+++ b/file1
@@ -1,3 +1,7 @@ added file1
added file1
another line of text
+<<<<<<<
+changed file1 different
+=======
changed file1
+>>>>>>>
M file1
f248da0d4c3e+ tip
f248da0d4c3e tip
f248da0d4c3e tip
f248da0d4c3e tip