Conditional override of stdio/stderr so tests can run normally