opengl: fix and refine memory barriers

The current memory barriers were either used illegally
(tex_gl->target??), overspecified (e.g. the forced barrier after
glDispatchCompute), or just plain missing (e.g. barriers for storage
images that might also be used in other ways).

Fix this mess by making the barrier usage consistent:
1. Only submit memory barriers on descriptors when unbinding them from
   shaders that might write to the resource
2. Skip unnecessary memory barriers for readonly resources
3. Submit *all* the barriers required for the object's usage flags
11 jobs for v2.72.0 in 7 minutes and 36 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Build
passed #405518
aarch64 docker
build-aarch64

00:00:36

passed #405519
macos
build-macos

00:00:11

passed #405514
amd64 docker
build-ubuntu

00:00:40

passed #405515
amd64 docker
build-ubuntu-static

00:00:39

passed #405516
amd64 docker
build-win32

00:00:19

passed #405517
amd64 docker
build-win64

00:00:18

 
  Test
passed #405521
gpu
test-gpu

00:01:38

76.9059%
passed #405522
gpu
test-gpu-asan

00:01:56

passed #405523
gpu
test-gpu-msan

00:01:43

passed #405524
gpu
test-gpu-ubsan

00:01:35

passed #405520
amd64 docker
test-ubuntu-scan

00:00:33