[plugins/qpa] Split out EGL helpers
Summary: This change is a prerequisite for adding offscreen surface support.
Reviewers: KWin, romangg
Reviewed By: KWin, romangg
Subscribers: kwin
Tags: KWin
Differential Revision: https://phabricator.kde.org/D22196