mesa: recover target_check before get_current_tex_objects

At compressed_tex_sub_image we only can obtain the tex_object after
compressed_subtexture_target_check is validated for TEX_MODE_CURRENT.
So if the target is wrong the error is raised to the user.

This completes the fix for the regression introduced on "mesa: refactor
compressed_tex_sub_image function" of the pending failing tests:

dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage3d
dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.compressedtexsubimage3d

v2: Fix warning that texObj might be used uninitialized (Gert Wollny)

Fixes: 7df233d6 ("mesa: refactor compressed_tex_sub_image function")
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
22 jobs for !1731 with second_fix_compressed_tex_sub_image in 14 minutes and 47 seconds (queued for 3 seconds)
detached
Status Job ID Name Coverage
  Containers Build
passed #523435
debian

00:00:24

 
  Build+Test
passed #523444
meson-arm64

00:02:23

passed #523443
meson-armhf

00:03:06

passed #523437
meson-clang

00:08:01

passed #523441
meson-clover

00:08:56

passed #523445
meson-i386

00:02:46

passed #523440
meson-main

00:10:48

passed #523436
meson-swr-glvnd

00:05:17

passed #523442
meson-vulkan

00:02:41

passed #523447
scons-llvm

00:05:05

passed #523446
scons-nollvm

00:05:36

passed #523438
scons-swr

00:05:36

passed #523439
scons-win64

00:05:19

 
  Test
passed #523448
test-llvmpipe-gles2 1/4

00:02:18

passed #523449
test-llvmpipe-gles2 2/4

00:02:29

passed #523450
test-llvmpipe-gles2 3/4

00:02:17

passed #523451
test-llvmpipe-gles2 4/4

00:03:33

passed #523452
test-softpipe-gles2 1/4

00:01:06

passed #523453
test-softpipe-gles2 2/4

00:01:04

passed #523454
test-softpipe-gles2 3/4

00:01:24

passed #523455
test-softpipe-gles2 4/4

00:01:23

passed #523456
test-softpipe-gles3-limited

00:02:19