Add check for setlocale()

In wide char mode it is important to be sure that setlocale() function
succeed.
Merge pull request #10 from manuel-arguelles/check_locale

Add check for setlocale()