mesa: remove handcounted magic number

Also make it a compile-time error with STATIC_ASSERT.
mesa: extend get_texobj for multitexturing
mesa: add helper functions for TexParameter* funcs
mesa: clarify error message
mesa: improve debug message
main: add _mesa_get_and_init_texture()

Needed for GL_EXT_direct_state_access.
mesa: pull out texture object lookup in TexImage*D code

Prepare for GL_EXT_direct_state_access entrypoints.
mesa: add _mesa_get_tex_unit()
mesa: pull out texture object lookup in CopyTexImage*D code

Prepare for GL_EXT_direct_state_access entrypoints.
mesa: lift texture lookup out of error checking

Have callers do it instead.
mesa: reconsolidate teximage checking
mesa: lift texture lookup out of error checking

Only lookup the texture object once.
mesa: lift texture lookup out of error checking again

Only lookup the texture object once.
mesa: lift texture lookup out of error checking again again

Split out the large switch statement to its own function.

And only lookup the texture object once.
mesa: lift texture lookup to caller for Tex*Multisample functions
mesa: factor out _mesa_max_tex_unit()

This is about to appear in a lot more places, so
reduce boilerplate copy paste.
mesa: add glMultiTexSubImage*DEXT() functions
mesa: add glCopyMultiTexImage*DEXT() entrypoints
mesa: add glCopyMultiTexSubImage*DEXT() entrypoints
add _mesa_get_tex_unit_err() checking getter function

Reduce boilerplate across files.