SIGCHLD handler uses volatile variable to prevent problems with gcc -O2