Prevent failing if qgis.core is not available

Work around for issue #678