Output to stdout and stderr directly.

This way, if a generated program that takes time to run, you'll see
partial output immediately instead of all at once at the end.
Also, stdout and stderr output of generated program is correctly
preserved.