Add the st_isclosed to the polygon creation

Used a simple first node = last node check before, and it failed in certain cases