Fixing zombie process appearance and hang up on shutdown.
Fixing zombie process appearance and hang up on shutdown.

After the c8790d2a89bb commit, the SIGCHLD handler may return before processing
all awaiting PIDs.  To avoid zombie processes and ensure successful main
process termination, waitpid() must be called until an error is returned.

This closes #600 issue on GitHub.

nginx/unit,nginx/unit,nginx/unit,nginx/unit,nginx/unit,nginx/unit,nginx/unit,nginx/unit,nginx/unit,nginx/unit,nginx/unit