Fix some thread handling issues in InputMethodManager

- Make sure onCheckIsTextEditor should be called on the UI thread for
preventing exception in some cases that will break start input background
thread.

- Refine IMM#checkFocus and DelegateImpl#startInput to be out of
lock object to prevent start input background thread may blocked by other
methods which already inside the lock.

- Cache InputMethodManagerDelegate object for ImeFocusController#getDelegate.

Fix: 147447217
Bug: 141738570
Test: manual as test steps:
     1) Launch Keeeps app, type some web-URL link.
     2) Long press on any URL link > From the toolbar select "open / browser"
        and observe.
     3) Expect the soft-keyboard should be hidden after entering the
     browser page.
Test: atest CtsInputMethodTestCases

Change-Id: I098df41f935438bf1889fb030c7a3e7a0645a168
2 files changed