threadLocalStreamSubstitution

Substitution happens only for the main thread in all non-standalone modes, because there may be outputs not related to the cell being executed.

In standalone mode, all outputs from threads should be printed.