Fix issues with replication of optimizing RPCs
This MR two bugs and three performance issues with our current replication logic for idempotent optimizing RPCs:
- We didn't replicate the
prune
parameter of GC calls. - We didn't replicate the
all_refs
parameter of PackRefs calls. - We didn't special-case WriteCommitGraph, OptimizeRepository and MidxRepack.
Relates to https://gitlab.com/gitlab-com/gl-infra/production/-/issues/5044, #3670 (closed).