Prevent crash when using non-existent locale

As the comment says, a quick and dirty temporary solution to the crashes in Android with non-existent locales.