Merge "Fix some thread handling issues in InputMethodManager"