KisDocument::Private::SafeSavingLocker uses a member
KisImageBarrierLockAdapter m_imageLock to do the locking of KisImage.
Which it explicitely locks and unlocks again, to keep locking in balance,
together with std::try_lock.
But KisImageBarrierLockAdapter in its deconstructor unconditionally also
calls unlock on the image, without taking into account any state of other
unlock/lock calls.
Which then triggers the Q_ASSERT(locked()); in KisImage::unlock().
BUG: 363279