Fixed a crash in QgsMapLayerModel (when opening a new project)