fix subprocess.Popen.wait() PIPE deadlock due to large data