Redesign/improve scheduler stdout/stderr tracking.

Tested on mosix!