CTest: Fix reported duration on timeout when grindchild keeps pipes open
Since !4217 (merged) we no longer hang, but the test duration we report after the timeout is the amount of time the immediate child ran before exiting. Fix the logic to instead report the actual amount of time we spent monitoring the test before the timeout.
Fixes: #20509 (closed)
Backport: release:HEAD^2
Edited by Brad King