Fix NPE in Settings -> Language & input -> Default -> Setup input methods

If the InputMethodAndLanguageSettings fragment is launched in IME-only
mode, it removes most preferences, so we need to null-check them before
use.

Change-Id: Ifcd1358bdee69d06877510e0eafe88aa43021780
Merge branch 'android-4.4' of https://github.com/omnirom/android_packages_apps_Settings into android-4.4