Simplify the test for IPC::Open bug RT #72016.
The original bug was a request that errors be reported in the parent process,
with a TODO test, and then a patch that added the feature for the !DO_SPAWN
case, and removed the TODO. The *implication* of the bug report and the way the
original test was only TODO for the !DO_SPAWN case was that errors were
reported inconsistently between the two code paths of open3().
However, this is not the case - the DO_SPAWN path through open3() return a
(pseudo) PID (and no error) when asked to run a non-existent program. Hence
there is now a feature discrepancy between the alternative implementations,
which feels like a bug that should (ultimately) be addressed.
The original test could have expressed that more directly with one code path
and a TODO. The refactoring of
bd29e8c290c68f4f failed to spot this, and
introduced new logic errors in the DO_SPAWN path - waitpid() should not be
called if $@ is set.
Set $pid outside the eval {} - this makes sure it is (re)set to undef if the
eval fails, instead of holding its previous (now bogus) value.