checkout: support checking out into a new working directory

"git checkout --to" sets up a new repository linked to the current one
with the new .git file format. It then creates a fake commit with
empty tree and executes "git checkout" again on the new worktree with
the same arguments except "--to" is taken out. The second checkout,
which is not tamed with any info from the current repository, will
carry out normal operations that checkout does.

$GIT_DIR/repos is made shared across working directories so all can
see how many working directories are attached to a repository and take
appropriate action.
checkout: clean up half-prepared directories in --to mode
setup.c: keep track of the .git file location if read
prune: strategies for split repositories

alias REPO=$GIT_SUPER_DIR/repos/<id>

 - split repos are supposed to update mtime of $REPO/gitdir

 - split repos are supposed to keep its location in $REPO/gitdir up to
   date

 - "git checkout --to" is supposed to create $REPO/locked if the new
   repo is on a different partition than the shared one.

 - "git checkout --to" is supposed to make hardlink named $REPO/link
   pointing to the .git file

The pruning rules are:

 - if $REPO/locked exists, repos/<id> is not supposed to be pruned.

 - if $REPO/locked exists and $REPO/gitdir's mtimer is older than a
   really long limit, warn about old unused repo.

 - if $REPO/link exists and its link count is 1, repos/<id> is to be
   pruned.

 - if $REPO/gitdir's mtime is older than a limit, and it points to
   nowhere, repos/<id> is to be pruned. Warn about it some time before
   the prune time.
refs: adjust reflog path for repos/<id>/HEAD
refs: detach split repos' HEAD when the linked ref is updated/deleted

This is effective when a ref is updated from the super repository as
well as all linked repositories because "repos" directory is shared
between all repos.

We could even forbid a ref update if it's some repo's HEAD. But I'd
rather see a generic, permanent ref locking mechanism in place first
and make use of it.

XXX: a split repo can't see HEAD of the original repo because it does
not exist in $GIT_DIR/repos.
refs.c: refactor do_head_ref(... to do_one_head_ref("HEAD", ...
rev-list: include repos/xx/HEAD in --all

This makes sure repack won't drop detached HEADs from $GIT_DIR/repos/