Replace the subsurface queue by a tree.

This allows the same surface to appear several times in the sequence of
drawings: for example drawing A on B and then B on A again.
This case happens with scrolling transitions.

This change also seems to improve things on transitions.