Fix crash after Qt.quit on Arm Mali GPU
There is an issue on Mali that keeps a pointer to the old wl_surface
which was current before, and when we make the new surface current it
tries to access it, even it have already destroyed it at that point.
The issue is reported here:
https://community.arm.com/support-forums/f/graphics-gaming-and-vr-forum/8146/r12p0-wayland-driver-odroid-xu3-frees-objects-too-early-leading-to-segm-fault/36417
Avoid the crash by calling eglMakeCurrent(EGL_NO_SURFACE) before
wl_surface destroy as the workaround for Mali GPU only.
Pick-to: 6.5 6.7 6.8
Fixes: QTBUG-127980
Change-Id: I900de9ce0f8ee32a7148f54c9aa53d36dc5d9bec
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>