newlib: add C++ guards to the platform-specific dirent.h (backport 4.3) See merge request espressif/esp-idf!14621