wayland: Release input focus when window is destroyed

This fixes a seg. fault on the reopen test because events might occur
after the window is destroyed (for example leave events).
Merge pull request #333 from ricardomv/fix-reopen

wayland: Release input focus when window is destroyed.