fix Issue 13258 - std.process file closing logic is incorrect

https://issues.dlang.org/show_bug.cgi?id=13258