Fix crash on closing Creator
Fix crash on closing Creator

Removing a target setup widget might lead to removing a kit,
due to some kits being temporary for importers.

A kit removal then would lead to a target removal and this would
make the code recurse into the widget cache.

Fix that by ensuring that we disconnect from the project first in
ProjectWindow::deregisterProject. And also remove the clearing of
the project window, instead simply clear the widget cache as each
project is closed.

Change-Id: I278c43ef4ba77217428c5c36f0a07d0d96cb3022
Task-number: QTCREATORBUG-14694
Reviewed-by: Nikolai Kosjar <9571db158ca61a0d070db010803474231fa0cbab@theqtcompany.com>
Reviewed-by: Daniel Teske <d8a411aec9a206efedb4d45b75fe8d13f1e2b628@theqtcompany.com>

martyone/sailfish-qtcreator,martyone/sailfish-qtcreator,xianian/qt-creator,xianian/qt-creator,xianian/qt-creator,xianian/qt-creator,martyone/sailfish-qtcreator,martyone/sailfish-qtcreator,xianian/qt-creator,martyone/sailfish-qtcreator,martyone/sailfish-qtcreator,xianian/qt-creator,xianian/qt-creator,xianian/qt-creator,xianian/qt-creator,martyone/sailfish-qtcreator,martyone/sailfish-qtcreator,martyone/sailfish-qtcreator