[spatialite] Don't crash with NULL geometries (Fix #8739)