fix to_geojson polygon output after bug introduced in merge 76f111cc97a86cb029 - closes #2019