Wait for the child properly and check its exit code to ASSERT in the
parent.