Issue #10512: close the log file in cgi when running tests.

Thanks to Nadeem Vawda for the find and an initial fix.
2 files changed