[server] Add method to get to the main surface from a sub surface
Summary:
Recursively go up to the main surface, that is the top level surface
which doesn't have a parent.
This is useful to know to which surface tree a sub-surface belongs to.
Reviewers: Plasma
Subscribers: plasma-devel
Projects: Plasma
Differential Revision: https://phabricator.kde.org/D1207