window: fix segfault in window_handle_key()
window: fix segfault in window_handle_key()

When a window destroyed, if any input had the window in keyboard
focus, the keyboard focus is reset to NULL. A new keyboard focus is set
only, if the user clicks something. If the user presses a key instead of
clicking, the key press event is sent to the client which has NULL
keyboard focus, triggering a segfault in window_handle_key().

Fix the segfault by ignoring the key event, if there is no target
window.

I triggered this segfault by clicking the unlock dialog away, and then
pressing a key.

Signed-off-by: Pekka Paalanen <6c0263d81461c956d504307112a4ce25eaacc3d1@gmail.com>

giucam/weston,jonnylamb/weston,Gnurou/weston,Tarnyko/weston-xdg_surface_present,kwm81/weston,udoprog/weston,Fantu/compositor-spice,Fantu/compositor-spice,kwm81/weston,krezovic/weston,xorgy/weston,Fantu/compositor-spice,eyolfson/weston,giucam/weston,Gnurou/weston,krezovic/weston,Tarnyko/weston-xdg_surface_present,xorgy/weston,sir-murray/weston,sir-murray/weston,mchalupa/weston,mchalupa/weston,jonnylamb/weston,eyolfson/weston,udoprog/weston