Fixing test cases on OS X, since pubsetbuf doesn't work

`pubsetbuf` isn't guaranteed to change the underlying buffer, and it in fact doesn't on OS X 10.10 (compiling with clang-600.0.54), which causes test failures. Initializing an `ostream` with a custom stream buffer should be cross-platform, however.