egl/drm: check for dri2_dpy->flush before using the flush extension