sync: Run `git gc --auto` after fetch

Users may wind up with a lot of loose object content in projects they
don't frequently make changes in, but that are modified by others.

Since we bypass many git code paths that would have otherwise called
out to `git gc --auto`, its possible for these projects to have
their loose object database grow out of control.  To help prevent
that, we now invoke it ourselves during the network half of sync.

Signed-off-by: Shawn O. Pearce <sop@google.com>
(cherry picked from commit 1875ddd47c0bf38e5cc52e1e5875caabce2d8742)
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 80bba1a..36ef16d 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -185,6 +185,8 @@
         t.join()
 
     pm.end()
+    for project in projects:
+      project.bare_git.gc('--auto')
     return fetched
 
   def UpdateProjectList(self):