mesa: add support for threaded glLinkProgram (WIP)

   /*
    * We need a way to figure out if these driver hooks
    *
    *   ctx->Driver.NewShader
    *   ctx->Driver.DeleteShader
    *   ctx->Driver.LinkShader
    *
    * are thread-safe.  For i965, it seems to be the case except for
    * brw_shader_precompile.
    */

For brw_shader_precompile, we should calculate shader keys ahead.

Signed-off-by: Chia-I Wu <olv@lunarg.com>