ogr provider: avoid GDAL #4509 (fixes #8232)