fix crash when changing language from non-GUI thread (fixes #15113)

This fixes a crash when someone tries to change the language from a non-GUI thread (e.g. python or JSON-RPC) as reported by @joethefox in http://trac.xbmc.org/ticket/15113.
It might also take care of an occasional hang when changing the language from the settings window (but I was never able to reproduce that myself).