Use union types instead of overloading for buffer[Sub]Data and tex[Sub]I...

...mage2D.

This fixes https://www.khronos.org/bugzilla/show_bug.cgi?id=1172 .