egl: rework offscreen rendering buffer sharing functionality to be more reliable

Signed-off-by: Simon Busch <morphis@gravedo.de>
egl: minor cleanups to EGL API implementation

Signed-off-by: Simon Busch <morphis@gravedo.de>