Bring eglSwapBuffers closer to actual documentation.
Checks now whether ctx was initialized and not lost. Does a glFlush before returning.
And returns success codes from function.