Use temporary clones for relaying instead of temporary remotes

The branch tracker adds a temporary remote to the persistent relay
repository each time it wants to fetch a branch from a remote repository.
This works, and saves us the trouble of keeping track of whether there
is a suitable remote or not and what its name is (and some other special
cases.)  However, it turns out that not keeping the remote (and thus a
record of what refs have been fetched from it already) causes "git fetch"
to fetch a lot of objects over and over from the remote, despite them
already being in the local repository, which causes the local repository
to grow indefintely (until GC:ed or recreated.)

To avoid this, and also avoid potential race conditions from concurrent
use of the persistent relay repository, do the relaying in a temporary
clone instead.  Creating a bare clone on the same file system is almost
instantaneous and cost-free.

TODO: Should document the fact that because of this, in particular the
assumption that creating a clone is very cheap, DATA_DIR and GIT_DIR
should be located on the same file-system.  The install script should
also warn if the configured paths are not on the same file-system.
Improve error logging on failed operation

If the status is not the expected one and is "error" or "failure", log
the actual error message (or failure code) too.  It's probably a better
hint at what's wrong than the status itself.
Clean up (standard library) imports in gitutils

Remove duplicate imports; prefer "import X" over "from X import Y"

In particular, don't "from subprocess import Popen as process"; just do
"import subprocess" and call it as "subprocess.Popen" in the code.  (The
name is ugly, but it is what it is.)
Unbreak layout on /checkbranch (the input form version)

At some point the structure of the branch status version of the page and
stylesheet (checkbranch.css) was updated, but the structure of the input
form version of the page was not given matching love.  Do that now, and
also "modernize" it somewhat.

Also, some minor tweaks to basic page generation utilities:

- Always set class ("repository") on the <select> element generated by
  generateRepositorySelect(), and add basic styling of it to basic.css.

- Let PaleYellowTable set document title to same as table title if the
  document doesn't already have a title set.
Add basic test for /checkbranch
Add basic test for /fetchremotebranch
Start Critic background services before Apache

The only real upstart dependency is that wsgistartup.py tries to
write its pid file to a directory created by the init.d script and
fails if the init.d script hasn't created the directory yet.

That problem could obviously be fixed in wsgistartup.py as well.

But technically the web front-end does depend on the background
services, so ought to start after.
Enable auto-completion of user names and paths on /createreview

Reusing code from /showreview.  To support auto-completion of paths, the
/getautocompletedata operation had to be extended, since it only supported
listing (relevant) paths per review (given a review id.)  Since we haven't
created a review yet, we have no review id.  Give /getautocompletedata a
list of changeset ids instead, which we do have.
Prepend install_dir to sys.path while installing

This way, when an installation script imports Critic modules it
imports them from install_dir instead of from $PWD.  This makes a
difference if the installation script has switched uid/gid to the
Critic system user/group, in which case it might not have access
to files in $PWD anymore.

Specifically, this makes it possible for installation/prefs.py to
import dbutils.py after setting uid/gid.
Fix serious issue in installation.utils.update_from_template()

The point of the function is largely to figure whether it should actually
update the file or not (in case it has local modifications.)  It does this
by setting the local 'write_target' to either True or False.

And then it updated the file either way...