fix print_utf8_string() on win32

1. don't call WriteConsoleW() on redirected stdout
2. call fflush() before calling WriteConsoleW()