[client] Fix two GC related bugs.

* Don't index worktree when GC is running;
* Save remote head id for normal download tasks too.