Issue #18174: Fix fd leaks in tests.
3 files changed