Lock the entire texture, not just the pixel array.

Fixes #49