Templatize some of the more repetitive initialize-check logic so that
we can just try and create every individual type, see if creation succeeded
and then return true if it did.
Merge pull request #2464 from smspillaz/refactor-egl-selectors

Refactor the EGL implementation selection code in EGLWrapper.