Ignore EINTR in workers when terminating due to SIGTERM

If the child process is killed using SIGTERM by the parent, send(2)
can fail with EINTR. Install a signal handler for SIGTERM and ignore
EINTR in this particular case.

Fixes #325.