Some simple wayland build fixes for newer mesa versions

The implementation for 83975e4 is a little questionable. If anybody knows a better way to do that, please suggest it and I will amend that commit.

These fixes just allow us to build on more recent versions of mesa. They are backward compatible changes.