Extended geometry cloning for efficient LineString<->LinearRing conversion

This commit improves the efficiency of creating a `LineString` from a `LinearRing` or vice versa, in both ctypes and cython. This is built on top of the work done by @jwass.