Use QPointer for modal dialogs
Summary: Fixes a potential crash as found by Krazy.
Reviewers: Zanshin, dfaure, bensi, franckarrecot
Differential Revision: https://phabricator.kde.org/D5833