[client] Fix a bug in clone manager and GC.

After merging with an existing folder, create a "index" branch to
to refer to new changes from the worktree.

Previously we fulfill the same goal by forcing a commit operation
before setting repo->head. However the commit routine requires
repo->head and repo->worktree be set. This method is buggy and
doesn't work.
[client] Improve clone procudure.

* Set repo->worktree before setting repo->head.
* Don't check worktree on start-up if repo's head is not set.