char: remove use-after-free on win-stdio