Fix race condition in CopyD3D8CPUTextureThread