nc: trap SIGPIPE failures writing to socket
If something goes wrong when writing data to the unix socket that
is a pipe to taskd.pl, then potentially a SIGPIPE could be generated
rather than a simple error result code.
Trap the SIGPIPE (with a nop) so that any error can be handled
normally via the usual status result code reporting.
The post-receive hook already had this, but due to various code
changes since it was originally added it had been rendered ineffective.
Fix that as well.
Since the desired default behavior is not to simply ignore a SIGPIPE,
the default signal handler for SIGPIPE is restored after writing
to the taskd.pl pipe.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>