Replaced HAS_SPATIAL_DB by testing database feature

Refs #22632. This should be the base for using more database
features to exclude specific backends in GIS tests.
Thanks Tim Graham for the review.