Restore r59 from google code's float branch, original commit message follows

This fixes a potential error in with the texture stack should the host app
change active texture units, and our stack not get popped properly - resulting
in a stack over flow for the GL_TEXTURE matrix. Noted by Brian working on
Unity), as well as fixing an issue with the framework not properly setting
client texture unit to 0.