Fix glXCreateContextAttrib always null
Add some error detection
Fix two warnings on X11