WIP: Nouveau threading fixes
This adds a lock per pushbuffer which a thread needs to acquire before doing any operation on it.
There are multiple other ways we could fix threading, but this is the most straightforward one, seems to work and doesn't require a big rework of everything.
Seems to work fine on my TU117 and
./glcts --deqp-visibility=hidden -n '*multithread*'
There are some kernel space races which are visible to userspace leading to random crashes, but I think I got at least all the ones from userspace.
- fix memory management code
- fix concurrent accesses to fences
- races on bufctx objects in nvc0