fixed python3 stdout/stderr line buffering