Fix race condition in KisMergeWalker::startTripWithMask
Summary:
The parent pointer could become null right after the check.
Making it safe is easy, just hold on to the pointer for the duration
of the function.
Reviewers: Krita
Differential Revision: https://phabricator.kde.org/D3388