Fixes #2583, clean up EGL initialization
Assorted fixes for NaCl. Hat tip to Sylvain Becker