Don't throw exceptions when encoding empty geometries to GeoJSON

This PR fixes a bug that was causing the GeoJSON encoder to throw exceptions when asked to encode empty geometries.  GeoJSON specifies that geometries with no coordinates are invalid so I treated such geometries as equivalent to null.  It is no longer the case that encoding followed by decoding will give back an equal value but I believe it is worth it to avoid the unhandled exception.
Here you might want to use geometry.isEmpty() instead of checking if the coords are zero lenght, as that array needs to be built at runtime for every multigeometry and every geom using non default coordinate sequences.