Catch more specific exceptions when testing for GEOS/GDAL availability.