Put KisApplication's d-pointer in a QScopedPointer
(cherry picked from commit 68b57f8bdf1c3e56835ba8c266cb9180a44c240c)