Fix locale handling when building with cmake

* Add `check_symbol_exists` for locale handling (it was commented out before)
* Mac OS: use header "xlocale.h" for checks
* Apply the result of these checks not only to `libconfig`, but also `libconfig++`
* This fixes the build warning "No way to modify calling thread's locale!"
* This also fixes the memory leak on Mac OS as described in issue #212.
1 file changed