Make Dialog ignore focus events on other documents.

This fixes the problem in a Dialog where an InlineEditBox with a dijit/Editor editor
would immediately close because the Dialog thinks the focus had shifted back to the
main document somehow, and restores focus to itself.

A more robust solution would be to trace if the foreign document is in an iframe
that's a descendant of the Dialog, but it didn't seem worth the extra code.

Fixes #17225.

(Backport to 1.9, cherry picked from commit 2341c812b14bb1a246b874836aed3e3f2e337347)