Fix handling of elements that go stale during lookup

This pulls in the changes that Jari made to my code in the watir/watir-webdriver repo. He changed where the error capture happened, and I think it is better than where I put it.

(cherry picked from commit a9a2360)