Fix the calls to pre- and post-receive custom hooks

- Reset G_ID if the custom pre-receive hook fails
- Use a pipe to feed stdin to the custom pre- and post-receive
  hooks, in the same way that the standalone git works
Merge pull request #3 from jkbzh/patch-1

Fix the calls to pre- and post-receive custom hooks