wayland: Plug surface pending state contents leak
When moving the pending state from an effectively synchronized subsurface to be applied with the parent surface, we are leaking the data allocated on pending_state_init() after surface->sub.pending was last applied. This means we leak data on every wl_surface_commit() in an effectively synchronized subsurface.
Instead, simply clear the pending state data after applying it, and ensure surface->pending is initialized for the next time. If it belongs to a synchronized subsurface. This state will be moved to an entirely cleared surface->sub.pending, which will be cleared itself after applying.
Related: gnome-shell#64 (closed)
Edited by Carlos Garnacho