[Bug 33715] freopen produces empty file when applied to stdout