fetch exit code of a closed pipe on windows