Use commit() instead of apply() for String preference writes to ensure
the value is written to disk synchronously before the process is killed
during restart().
Root cause: SharedPreferences.apply() writes to memory immediately but
commits to disk asynchronously. When context.restart() calls
Process.killProcess()+exitProcess(0) immediately after writing the
language preference, the async disk write may not complete, causing the
new process to read the old value.
Closes#862
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>