3775: Fix crunch-job exit status: exit non-zero after "freeze"
path (which includes task failure, INT, TERM, etc.)

Also fix wrong todo list (and therefore todo count in progress stats)
after permanent task failure.
3775: Merge branch 'master' into 3775-fetch-git-repo
3775: Fix syntax error 2 commits ago.
3775: Remove stagnant $job_has_uuid flag. Every job has a uuid. The
only time to skip updating the job record on the server side is when
croak() happens before $Job is created/fetched.
3775: Run local/dev jobs on code from arbitrary remote git repositories.

* repository is a local path X -> use local repository X or X/.git.

* repository is a git url (git://, https://, git@host:repo.git, etc)
  fetch branches, tags, and objects from the remote and use the result
  to resolve script_version to a commit sha1 and run the job.

* else -> look up the named repository in Arvados and use its
  fetch_url as a remote git url as above.

* --git-dir is given on the command line -> use that instead of
  $Job->{repository} in the above logic. (This isn't new. It ensures
  we don't go off fetching arbitrary remotes when crunch-dispatch.rb
  has already pulled the code into its own internal git repo.)

Incidental changes:

* Lose support for looking up subversion revision numbers using
  git-svn tags.

* Lose support for CRUNCH_DEFAULT_GIT_DIR environment variable. Pass
  --git-dir instead.

* Improve log messages during checkout/install phase.
3775: Add TODO comments in suspicious-looking collate_output corners.
3775: Clean up reporting of exit codes: say "0 with signal 2", not "512".
3775: Remove redundant log message.
3775: Merge branch 'master' into 3775-fetch-git-repo
3775: Recognize ssh short form without @ symbol. Expand comments.
3775: Merge branch 'master' into 3775-fetch-git-repo

Conflicts:
	sdk/cli/bin/crunch-job
3775: Set state=Running when creating a Job in local mode.
Merge branch '3775-fetch-git-repo' closes #3775