[geometry] Impose closed rings of any polygon output in WKT (ticket #9217)