mesa/st: use a lock to protect access to variants when updating them
Multiple threads may access st_update_* function at same time. Issues happen when the threads modify lists managed by shader compiler.
Issues were found with script that runs multithread tests 1000 times in a row with MESA_GLSL_CACHE_DISABLE=1 set. Problems start when 2 simultaneous st_create_[vp|fp]_variant calls start to compile a new shader variant for the same program and various nir passes use and modify same exec_lists.
Example failure: deqp-egl: ../src/compiler/glsl/list.h:575: exec_list_validate: Assertion `node->next->prev == node' failed.
Signed-off-by: Tapani Pälli tapani.palli@intel.com