Don't reschedule when writing to stdout.

Let's still capture the output, though.
Merge pull request #5851 from unknownbrackets/stdout-intr

Don't reschedule when writing to stdout.