Optimize searching for elements in selendroid

We used to walk the whole layout tree, store it in a list, and then walk through it again to find a match.

This changes it to search on the fly, thanks to this we save extra memory for the list and can break early in cases where we just want the first match.

Submitted on behalf of a third-party: Facebook