Work around Mali flips between stale DRI2 buffers

When resizing the screen under a mutter-based environment (causing
a new scanout buffer to be allocated), Mali is inconsistent about what it
does next (possibly depending on the position of the mouse pointer).

Sometimes it does not call GetBuffers immediately so it tries to flip
the old front/back buffers (which have the wrong resolution). This
confuses the state and makes future flips fail. Detect this case
and reject the flip so that subsequent flips work.

Most of the time, after this failed flip, Mail follows up with
GetBuffers and then a good SwapBuffers call, correcting the situation.
However there are also some cases where it only follows up with
GetBuffers and doesn't do a swap, a situation that I've not been
able to find a workaround for. When this happens the screen will be
black until the next update.