wayland: Call eglTerminate before destroying wl_display, not after
wayland: Call eglTerminate before destroying wl_display, not after

The eglTerminate code in Mesa will try to destroy the wl_drm object
which involves using data structures in the wl_display. Cogl was
disconnecting the display before calling eglTerminate which meant that
this would end up accessing potentially garbage data.

https://bugzilla.gnome.org/show_bug.cgi?id=705591

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 358d85f35d0fe36698b758163729c4551fe5fd25)

Distrotech/cogl,Distrotech/cogl,Distrotech/cogl,Distrotech/cogl