Remove some debug output
Simplify and fix signal handling

1) always use symbolic constant instead of numbers when sending signals. For example: freeBSD signal 12 is SIGSYS, while linux 12 is SIGUSR1. And default action for SIGSYS is terminate with a coredump.

2) no need to handle SIGINT/SIGTERM in child. parent will receive SIGCHLD in any way

3) localize $!, $^E, $@ in signal handlers, just in case - we don't really need to do it probably, as we just exit() in handler

4) make sure parent handler is called only once