Fix building with --egl with Mesa

I'm still a bit tricked by whether the regular functions can be looked up or not, but
with Mesa this now works. Please ping me if this messes up someone else.

Reviewed by Hugo Parente Lima.