Do explicit checks for window-like roles when getting the top-level object

We cannot count on the window-like object being an immediate child
of the accessible application.