Fix for dismissing popovers on iPad

This uses the correct window to find the dimming view.  It also fails if it can't find the dimming view, avoiding a case where it seemed to work but didn't.