Fixes #1726.

Replaces intersectSegmentPolygon and intersectLinePolygon "optimized"
implementations with the more robust implementations used for intersectLine and
intersectSegments
Merge pull request #1746 from manuel-freire/polygon-segment-intersection-fix

Fixes #1726 (precision problems in intersectSegmentPolygon and intersectLinePolygon).