treerror_internal(): Flush stdout and stderr.