CTest: Restore inheritance of stdin by test processes
Since !1455 (merged) we do not give the child test processes any stdin. Prior to that change we let the child test processes inherit stdin from ctest itself. Tests that run serially might be able to use the real stdin meaningfully, so restore that behavior and add a test case.
Fixes: #18591 (closed)