improve popen workaround for windows7 nand python 2.7 to prevent regression on other OSes