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.
requesting all changesabort: error: Connection refused255copy: No such file or directoryrequesting all changesabort: HTTP Error 404: File not found255