[1.7.x] Fixed the PostGIS circular imports caused by 1506c71a95.

Thanks to @loic for the help and @timgraham for the review.

refs #12030.

Backport of b9e50e4774 from master