changed polygon.centroid() behavior

it will now return the center of the bounding box for non-closed and for zero-area polygons