Protect against infinite recursion in focusOverlay

Note that this doesn't fix the root cause; it just tries to be a bit more
safe against corrupt state. Another PR is on the way to fix that.

An easy way to repro the infinite recursion is to create multiple *opened*
overlays, and dismiss them at the same time (toasts).