test: check the child has exited

On slow platforms like the beaglebone, SIGCHLD is received by the parent
but a slot in the process table has not been freed so the next call to
fork fails with {error, eagain} and the subsequent fork succeeds.

Check for the child by sending a kill(0).