[Bug 2554] Freopen() fails "invalid argument"