Fix valgrind + setlocale() issue
Merge pull request #2005 from sjinks/valgrind-setlocale

Fix valgrind + setlocale() issue