Fix valgrind + setlocale() issue