Don’t generate empty polygons during clipping.

Fixes #1823; spurious closePath events were being generated for degenerate polygons due to generation of empty polygons and rings in rare cases.