hook: Stop transactions when post-receive and update hooks fail
The pre-receive, post-receive and update hooks all have logic which will only run on the primary Gitaly node if transactions are in use. This includes the access checks for the pre-receive hook, but also the custom hooks logic implemented for all hooks. Executing custom hooks multiple times for a single change may break current assumptions about how they work in a single-node setup, so we shouldn't execute them multiple times in a Praefect setup either.
As only the primary will execute this logic, secondary nodes in a transaction wouldn't know about any potential failures. We have thus implmented a mechanism to gracefully stop transactions in 0d2ea9ff (transactions: Allow graceful stop of transactions, 2020-09-25). But right now, this logic is only executed for the pre-receive hook. Considering that primary-only failures can also happen for the post-receive and update hooks, this doesn't make a lot of sense.
Let's fix this by stopping transactions on failure of the primary for the post-receive and update hooks, too. While at it, this also unifies error messages when executing custom hooks.