postgis: avoid potential crash if connection is not initialized