gloo: Apply appropriate glPixelStorei in 2D tex upload

Closes issue #257