Fixed #23966: Adds `SELECT InitSpatialMetaData();` query execution

This query needs to be executed once at least, before migrating SpatiaLite-backend databases.