fix(core): make subprocess and temporary file tests portable on Windows (#39664)