reopening of stdout after freopen