Issue #18418: After fork(), reinit all threads states, not only active ones.
Patch by A. Jesse Jiryu Davis.
Issue #18851: Avoid a double close of subprocess pipes when the child process fails starting.