Add support for auto-fix geom structure for GEOS conversions

Fixes ST_ClipByBox2D run with non-closed polygon rings in input (#2945)

git-svn-id: http://svn.osgeo.org/postgis/trunk@13018 b70326c6-7e19-0410-871a-916f4a2858ee
Adapt the rest of the code to the change in LWGEOM2GEOS function

Fixes #2948 (introduced by previous commit)

git-svn-id: http://svn.osgeo.org/postgis/trunk@13019 b70326c6-7e19-0410-871a-916f4a2858ee