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.
Content-type: text/html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="icon" href="?static=hgicon.png" type="image/png">
<meta name="robots" content="index, nofollow" />
<style type="text/css">/*<![CDATA[*/ @import "?static=style.css"; /*]]>*/</style>