Switch to waitpid instead of wait4. Fixes #1