Fix query to detect postgis topology availability.

Closes #9453