Cleanup in X11 EGL platform

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
Fix typo

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
Transfer changes made to the X11 EGL platform also to the Wayland one

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>