Fix build with gdal 3.12

https://github.com/openstreetmap/merkaartor/pull/316
Index: src/ImportExport/ImportExportGdal.cpp
--- src/ImportExport/ImportExportGdal.cpp.orig
+++ src/ImportExport/ImportExportGdal.cpp
@@ -337,7 +337,7 @@ bool ImportExportGdal::importGDALDataset(GDALDataset* 
     qDebug(lc_importExportGdal) << "Layers #" << poDS->GetLayerCount();
     OGRLayer  *poLayer = poDS->GetLayer(0);
 
-    OGRSpatialReference * theSrs = poLayer->GetSpatialRef(); // Note: Contrary to other OGR objects, the spatial ref must NOT be released by our code!
+    const OGRSpatialReference * theSrs = poLayer->GetSpatialRef(); // Note: Contrary to other OGR objects, the spatial ref must NOT be released by our code!
     toWGS84 = NULL;
 
     if (theSrs) {
@@ -351,7 +351,6 @@ bool ImportExportGdal::importGDALDataset(GDALDataset* 
                 qDebug("GDAL: couldn't initialise EPSG:27700: %d: %s", ogrError, CPLGetLastErrorMsg());
                 the27700Srs->Release();
             } else {
-                theSrs->Release();
                 theSrs = the27700Srs;
             }
         }
@@ -390,7 +389,7 @@ bool ImportExportGdal::importGDALDataset(GDALDataset* 
                 Feature* F = parseGeometry(aLayer, poGeometry);
                 if (F) {
                     for (int i=0; i<poFeature->GetFieldCount(); ++i) {
-                        OGRFieldDefn  *fd = poFeature->GetFieldDefnRef(i);
+                        const OGRFieldDefn  *fd = poFeature->GetFieldDefnRef(i);
                         QString k = QString::fromUtf8(fd->GetNameRef());
                         if (k == "osm_id") {
                             F->setId(IFeature::FId(F->getType(), (qint64)poFeature->GetFieldAsDouble(i)));
