popen3 implementation in C for windows