lavapipe: rewrite/reorder
this rewrites lavapipe command streams to move descriptor updates after draw/dispatch commands and then flush states upon beginning queries, ensuring there are no use-after-free scenarios because descriptors will always be up to date
not sure this is entirely correct, but it does fix #4476 (closed)