Fix crash on teardown with Applet's ConfigLoader

Authored by davidedmundson on Sep 7 2019, 9:19 PM.

Description

Fix crash on teardown with Applet's ConfigLoader

Summary:
Deleting AppletPrivate will delete the ConfigLoader which will cause a
save, which can trigger a configSaved signal.

I think it is correct that the config might emit a signal just before
closing, and not at fault.

AppletPrivate is deleted by this point, but Applet is not so the
connection is still alive.

When we handle the signal, it goes into a Q_PRIVATE_SLOT that crashes.

This disconnect pattern is already used for guarding self config
changes.

BUG: 411221

Test Plan: kquitapp5 plasmashell, no longer crashes

Reviewers: Plasma, alexeymin

Reviewed By: alexeymin

Subscribers: alexeymin, kde-frameworks-devel

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D23707