Execute pre-receive hook

This patch work in my project.
Since this syntax should not just work for shell hooks, please pass in the list of refs here rather than stdin. E.g. for a Python-based post-receive hook I would expect that we'd just pass in the list of references, so that they don't have to parse an arbitrary string again.