There was an opportunity for the UiAutomation's binder
to die before it was connected, which caused an
NPE when it tried to connect.
I also moved the message handling to a different handler
to make it easier to test.
Bug: 65474486
Test: UiAutomation CTS passes. I also added a unit test
that failed in the same way as the bug. That test now
passes.
Change-Id: I31036ace114b21fed64227b62212b95267039d9e