the code that validated EGL objects dereferenced the object
to access its EGLDisplay -- needed for validation (!).
This was wrong for two reasons, first we dereferenced the object
before validating it (potentially leading to a crash), secondly
we didn't validate that the object existed in the right EGLDisplay.
We now use the EGLDisplay passed by the user API.
Change-Id: I66f9e851d4f8507892a6b1fee3065f124c4e7138
as specified by the EGL specification, terminated objects's
handles become invalid, the objects themselves are destroyed
when they're not current to some thread.
Change-Id: Id3a4a5736a5bbc3926a9ae8385d43772edb88eeb