catfile: Backport patches to fix leaking catfile processes (v15.0)
Backport patches that fix leaking catfile processes in Gitaly. This backports the following three MRs:
- !4581 (merged) to fix a potential deadlock in the gitpipe package.
- !4590 (merged) to fix a locking issue in the catfile package.
- !4598 (merged) to increase test coverage.