Shift to switching on SIGCHLD behaviour

capsicum-linux is changing behaviour so that wait() on pdfork()ed
children is possible, but this also means that SIGCHLD will be generated.
Emit more info from smoketest
Sort out sub-process tests; avoid direct getpid()

The implementation of getpid() in Linux's libc caches the value, and because
pdfork() is unknown to it, does not update the cache on pdfork().  Use the
syscall directly.

Also move process state checking to be a macro for better localization of
failures.
Enable cap-mode pdfork(PD_DAEMON) test on Linux
Add flock(2) test