Fixed bug in post-receive hook

Sometimes the post-receive hook won't exit if there is a child process runing.