keyboard: Only set toplevel when there is a valid output
keyboard: Only set toplevel when there is a valid output

Currently, the keyboard client is created and the input
panel surface is set as toplevel on the first output it
finds. This does not work in a scenario when there are
no outputs, resulting in weston-keyboard to crash at
startup due to operating on an invalid output pointer.

This makes input panel toplevel setting depend on a
valid output, and if there was no output present at
startup, it will be set toplevel as soon as an output
gets plugged in.

v2:

- Remove dependency on output pointer at startup
- Only setup output_configure_handler after the
  keyboard has been created
- Let the output_configure_handler handle toplevel
  setting in all cases

Signed-off-by: Armin Krezović <31ec4b88003c779f400d1506dcff569d5faae2fb@gmail.com>
Reviewed-by: Quentin Glidic <241385a0e41ea713327e189bce1062decf7c1eb5@sardemff7.net>
[Pekka: fixed a line break]
Signed-off-by: Pekka Paalanen <0f6ae7001e34c37b02fb2c1c2573ddf8f442136a@collabora.co.uk>

sir-murray/weston,krezovic/weston,sir-murray/weston,krezovic/weston