Fix a background NPE in A11yIME

This is a follow up CL to my previous CL [1], which aimed to clean up
A11yIME without changing any semantics.  One thing I overlooked is that

  android.accessibilityservice.InputMethod#mStartedInputConnection

can be set to null at any time (on the UI thread) and

  InputMethod.SessionImpl#invalidateInput()

needs to gracefully do early-exit as needed.

 [1]: I5ff2e804cbcf90828370a0612ff54111130bdff4
      c60176c1f315e10c95f3eec0019149d7b7932aa9

Fix: 245973012
Test: atest CtsInputMethodTestCases:AccessibilityInputMethodTest
Test: atest CtsAccessibilityServiceTestCases:AccessibilityInputConnectionTest
Test: atest CtsAccessibilityServiceTestCases:AccessibilityImeTest
Change-Id: I3bacff7772d20660bfdbeff724a0d19b5f0e6fe4
1 file changed