newlib: add C++ guards to the platform-specific dirent.h Closes IDFGH-5465 See merge request espressif/esp-idf!14308