make rawSystemIOWithEnv close its handles