Transfer focus based on displayable replacement.

When a displayable in a screen that has focus/grab is replaced,
we transfer the focus to its replacement. This fixes a problem where
we would transfer grab only, which could lead to a permagrab condition.

Fixes #477.