zink: Lock pipeline cache while creating it
This eliminates a race condition reported by ThreadSanitizer:
data race (pid=1464)
Read of size 8 at 0x7b7800009c90 by main thread (mutexes: write M0):
#0 zink_create_gfx_pipeline ../src/gallium/drivers/zink/zink_pipeline.c:434
#1 VkPipeline_T* zink_get_gfx_pipeline<(zink_dynamic_state)5, false>(zink_context*, zink_gfx_program*, zink_gfx_pipeline_state*, mesa_prim) ../src/gallium/drivers/zink/zink_program_state.hpp:232
#2 update_gfx_pipeline<(zink_dynamic_state)5, true> ../src/gallium/drivers/zink/zink_draw.cpp:409
...
Previous write of size 8 at 0x7b7800009c90 by thread T54:
#0 lvp_CreatePipelineCache ../src/gallium/frontends/lavapipe/lvp_pipeline_cache.c:51
#1 cache_get_job ../src/gallium/drivers/zink/zink_screen.c:402
#2 util_queue_thread_func ../src/util/u_queue.c:309
#3 impl_thrd_routine ../src/c11/impl/threads_posix.c:67
Edited by Gert Wollny