[1.6.x] Made an aggregate test pass with spatialite backend

backends.tests.SqliteAggregationTests was failing with spatialite.

Backport of 550b6195ed from master