Core: Use thread-safe readdir_r in not-Windows
Core: Move the config parser to settings.cpp