Fix traceback when a repo couldn't be locked