[1.7.x] Adapted SpatialiteGeometryColumns model to spatialite >= 4

See also:
https://www.gaia-gis.it/fossil/libspatialite/wiki?name=switching-to-4.0
Backport of 19d8f2ebf4 from master.
[1.7.x] Fixed #23030 -- Properly handled geometry columns metadata during migrations

Thanks kunitoki for the report and initial patches.
Backport of 8c30df15f1 from master.