Make StreamWriter optionally write to a stubbed stream.