Fix bug in OOM avoidance for RepoGroup cache.

Change-Id: Ic2e7fb6a9a7207315fd65454d883b84278efafc0
(cherry picked from commit 042baf43bdc60ef432bb5dc6c889226e62b06404)