gc.sh: improve loose object handling
In an attempt to coexist with linked working trees (and possibly
even non-bare repositories), Girocco trys to guarantee that any
unreachable loose objects persist for at least one min_gc_interval
period. They get packed up into an _o.pack that remains until the
next full gc takes place.
However, other than at a full gc, loose objects are left alone to
accumulate endlessly.
Girocco itself normally does not generate loose objects (although
a manually configured custom external VCS mirror might do so).
Nevertheless, improve on this situation by allowing a "mini" gc to
migrate "lotsa" loose objects into a _l.pack (and potentially combine
them if there get to be too many of them).
In order to maintain the one min_gc_interval guarantee, these _l.pack
packs are treated like they were still unpacked loose objects at
full gc time.
This results in improved efficiency by avoiding accumulations of
large numbers of loose objects prior to the next full gc at very
little extra cost. If there are no loose objects the cost is
practically zilch.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>