Revert "Revert "Fixed isolated child process blocks infinitely upon fatal error.""

This reverts commit 6ff66d23c2cb987305da3334fe706c1f2a7b8269.
DEBUG: Only close pipes after reading.