Minor changes to texture locking.
Add test case for texture locking.

Signed-off-by: Kristian Duske <kristian.duske@gmail.com>