glsl: add a singleton GLSL thread pool

This thread pool will be used by contexts to queue compilation tasks.
mesa: add infrastructure for threaded shader compilation

Drivers can call the new _mesa_enable_glsl_threadpool to enable the thread
pool, and set ctx->Const.DeferCompileShader and/or ctx->Const.DeferLinkProgram
to control what functions are threaded.

There is no restriction on DeferCompileShader, except that applications that
check the compile status immediately after glCompileShader will not benefit
from it.  Worse, they will get punished.  As for DeferLinkProgram, some driver
functions (see struct gl_constants) must be thread-safe.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
i965: add drirc option multithread_glsl_compiler

Setting it to a non-zero value N will cause shader compilation to be deferred
to a thread pool.  When N is greater than 1, it indicates the maximum number
of threads in the pool.  When N is 1, the number of threads is up to the
driver (two for i965).

Signed-off-by: Chia-I Wu <olv@lunarg.com>
i965: enable threaded precompile (WIP)