Fix Marshal and Psych support for native geos factories

When a factory uses native geos for wkb/wkt generation/parsing Psych
and marshal functions were unable to serialize the generators/parsers.
It seems like the methods assumed that the generators/parsers were WKRep
objects. In any case this prevents encode_with and marshal_dump from
calling a method on nil.