Interpolate the z-values of geom based on the z-values of its
first and last coordinates.
Does an interpolation on each indiviual Geometry of geom if it is
a GEOMETRYCOLLECTION.
Returns geom untouched if its first or last coordinate has no
z-value.
Returns NULL if geom is not a LINESTRING or a
MULTILINESTRING.