Merge changes from topic "BackportUiAutomatorRetry"

* changes:
  Let #getUiAutomation return null if UiAutomation fails to connect (3/n)
  Allow #disconnect to be called safely on connection timeout (2/n)
  Add #connectWithTimeout (1/n)