Fix java.lang.IllegalStateException: UiAutomationService not connected.

Fixes #675