highgui: wayland: don't allocate buffer twice
highgui: wayland: fix bug crashing when invoking wait_key()

I don't understand why this actually fixes this bug.
Valgrind reports invalid read of 8 bytes at key_queue access
of wait_key() and it crashes.