wayland: use a counter as sync flag
wayland: use a counter as sync flag

Wayland window has a pointer to the last pushed frame and use it to set the
flag for stopping the queue dispatch loop. This may lead to memory leaks,
since we are not keeping track of all the queued frames structures.

This patch removes the last pushed frame pointer and change the binary flag
for an atomic counter, keeping track of number of queued frames and use it for
the queue dispatch loop.

https://bugzilla.gnome.org/show_bug.cgi?id=749078

gbeauchesne/gstreamer-vaapi,CapOM/gstreamer-vaapi,01org/iotg-lin-gfx-gstreamer-vaapi,01org/iotg-lin-gfx-gstreamer-vaapi,01org/iotg-lin-gfx-gstreamer-vaapi,gbeauchesne/gstreamer-vaapi,ceyusa/gstreamer-vaapi,gbeauchesne/gstreamer-vaapi,CapOM/gstreamer-vaapi,GStreamer/gstreamer-vaapi,GStreamer/gstreamer-vaapi,CapOM/gstreamer-vaapi,ceyusa/gstreamer-vaapi