python subprocess popen flush stdout