Merged requested to merge olv/virglrenderer:fence-fixes into master
These are random fence-related fixes accumulated in my branch.
The first two commits are cleanups to the recent fence export change. Depending on whether sync thread is enabled, we either loop over vrend_state.fence_wait_list or vrend_state.fence_list, but never need to loop over both lists.
The next two commits fix broken sync thread (since the switch to meson) and plug a leak.
The last two commits move some code out of vrend such that vulkan can use it.