gl_wayland: fix crash after eglInitialze failed

Only execute most of the opengl termination procedure if we actually have an
egl context.