Clear tiles before dropping CompositorLayer

This fixes a pixmap leak and task failure (#2069).