Avoid subprocess.Popen with stdout/stderr=PIPE and wait() usage