yegl/wayland: fix glthread deadlocks
We need to make sure that glthread is idle before using wl_*
functions or they might be used from 2 threads at the same
time.
Thanks to @deltib for the investigation of this issue.
Fixes:
58f90fd03f4 ("egl/wayland: fix glthread crashes")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7624
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8136
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20887>