For nix-shell, set some more variables in preHook
GitInput.pm: Don't do a chdir to the Git clone

Doing a chdir in the parent is evil.  For instance, we had Hydra core
dumps ending up in the cloned directory.  Therefore, the function
‘run’ allows doing a chdir in the child.  The function ‘grab’ returns
the child's stdout and throws an exception if the child fails.
Don't pass an undefined input
Materialize the number of finished builds

The NrBuilds table tracks the value of ‘select count(*) from Builds
where finished = 0’, keeping it up to date via a trigger.  This is
necessary to make the /all page fast, since otherwise it needs to do a
sequential scan on the Builds table.
Index builds on stop time

This is necessary to make the /all page fast, since it sorts builds on
descending stop time.