Fix calculation of ends in ol.geom.MultiPolygon#getPolygons