xwayland: Use multiple window buffers

Xwayland takes care of not attaching a new buffer if a frame callback is
pending.

Yet, the existing buffer (which was previously attached) may still be
updated from the X11 side, causing unexpected visual glitches to the
buffer.

Add multiple buffering to the xwl_window and alternate between buffers,
to leave the Wayland buffer untouched between frame callbacks and avoid
stuttering or tearing issues.

Closes: xorg/xserver#835
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
3 jobs for issue835 in 3 minutes and 55 seconds (queued for 21 seconds)
Status Name Job ID Coverage
  Docker Image
passed debian-testing #1035331

00:00:34

 
  Build And Test
passed autotools-build-and-test #1035332

00:03:20

passed meson-build-and-test #1035333

00:01:52