[server] Don't crash when a subsurface gets commited whose parent surface got…

Authored by graesslin on Feb 4 2018, 3:57 PM.

Description

[server] Don't crash when a subsurface gets commited whose parent surface got destroyed

Summary:
Qt seems to damage and commit child subsurfaces although their parent
got destroyed. This actually doesn't make any sense as without a parent
surface they cannot be shown. But nevertheless we should not crash in
such a situation.

This change guards the places in the commit handling code where the
parent gets accessed.

BUG: 389231

Test Plan: New test case which exposes the problem

Reviewers: Frameworks, KWin, Plasma

Subscribers: plasma-devel

Tags: Plasma, Frameworks

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