patches: make clearing patches more efficient.

-The way it was before we were clearing all changes on a repo for
the number of patches we had in it. Now we just do it once per
repo.