Use a thread safe StringWriter for StdOut, StdErr and Trace

Fixes #164.