For an unknown reason, passing NULL pointer instead of &written worked on Windows 10 and on Windows 7 when stdout is not redirected. Closes https://github.com/espressif/esp-idf/issues/3740