glx/dri2: add and use new driver hook flush_with_flags