mesa: avoid triggering assert in implementation

When tearing down a GL context with an active performance query, the
implementation can be confused by a query marked active when it's
being deleted.

This shouldn't happen in the implementation because the context will
already be idle.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Closes: mesa/mesa#2235
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Tested-by: Marge Bot <mesa/mesa!3115>
Part-of: <mesa/mesa!3115>
41 jobs for !3115 with review/intel-perf-query-destroy-active in 16 minutes and 27 seconds (queued for 18 seconds)
detached
Status Job ID Name Coverage
  Container
passed #1176876
aarch64
arm_build

00:00:22

passed #1176878
aarch64
arm_test

00:00:23

passed #1176868
lava_arm64

00:00:21

passed #1176867
lava_armhf

00:00:30

passed #1176870
x86_build

00:00:26

passed #1176874
x86_build_old

00:00:20

passed #1176872
x86_test-gl

00:00:23

 
  Build
passed #1176882
lava-build:arm64

00:03:39

passed #1176880
lava-build:armhf

00:01:33

passed #1176890
aarch64
meson-arm64

00:03:01

passed #1176887
aarch64
meson-armhf

00:02:50

passed #1176892
meson-clang

00:05:11

passed #1176898
meson-clover

00:05:46

passed #1176900
meson-clover-old-llvm

00:05:50

passed #1176903
meson-i386

00:01:47

passed #1176885
meson-main

00:06:44

passed #1176905
meson-mingw32-x86_64

00:00:55

passed #1176884
meson-testing

00:03:38

passed #1176902
meson-vulkan

00:01:29

passed #1176907
scons

00:11:58

passed #1176909
scons-old-llvm

00:04:38

passed #1176894
scons-swr

00:02:12

passed #1176896
scons-win64

00:05:36

 
  Test
passed #1176932
db410c
arm64_a306_gles2

00:05:24

passed #1176929
mesa-cheza
arm64_a630_gles2

00:01:33

passed #1176931
mesa-cheza
arm64_a630_gles3

00:06:00

passed #1176930
mesa-cheza
arm64_a630_gles31

00:04:16

passed #1176911
lava-sun50i-h6-pine-h64
panfrost-t720-test:arm64

00:08:02

passed #1176913
lava-rk3288-veyron-jaq
panfrost-t760-test:armhf

00:07:47

passed #1176915
lava-rk3399-gru-kevin
panfrost-t860-test:arm64

00:08:29

passed #1176918
piglit-glslparser

00:03:30

passed #1176917
piglit-quick_gl

00:10:02

passed #1176920
piglit-quick_shader

00:03:32

passed #1176921
test-llvmpipe-gles2

00:04:02

passed #1176922
test-softpipe-gles2

00:02:01

passed #1176925
test-softpipe-gles31 1/4

00:03:37

passed #1176923
test-softpipe-gles3 1/2

00:04:57

passed #1176926
test-softpipe-gles31 2/4

00:04:12

passed #1176927
test-softpipe-gles31 3/4

00:08:31

passed #1176928
test-softpipe-gles31 4/4

00:03:24

passed #1176924
test-softpipe-gles3 2/2

00:04:06