Popen behaves differently on Windows and Posix system. Handle some command errors,