GEOS-5598: fixed exception in WMS GetLegendGraphic with generic GEOMETRY type