d3d11device: protect device_lock vs device_new
It seems that when D3D11CreateDevice collides in time with other D3D11 calls, in particular the proccess of creating a shader, it can corrupt the memory in the driver. D3D11 spec doesn't seem to require any thread safety from D3D11CreateDevice. Following MSDN, it is supposed to be called in the beginning of the proccess, while GStreamer calls it with each new pipeline. Such crashes in the driver were frequently reproducing on the Intel UHD 630 machine
Edited by Alexander Slobodeniuk