Restore Wayland compatibility.

Wayland compatibility was broken by e15ec56bf0237 because it wasn't deemed important. However chances are people will eventually start using Dolphin on that configuration, so we shouldn't frivolously drop compatibility without good reason.

This patch reintroduces the removed code portions with slightly cleaner coding style. Other than that, the VertexLoader UnitTest has been disabled when USE_EGL is enabled. This is an issue with PR #716, which didn't deem our Wayland support code important enough to justify further fixup of the interfaces. Ideally we'd fix this, but for lack of a time-efficient solution I'd just like to restore application compatibility for now.