tu: Free device->bo_idx and device->bo_list on init failure

Two related changes:

- in tu_device.c:tu_CreateDevice we need to free both pointers in the
  teardown path after tu_bo_finish(global_bo), which uses the pointers.
  They are allocated in the first call to tu_bo_init(), which happens
  when global_bo is allocated.

- in tu_drm.c:tu_bo_init we need to free bo_list if the bo_idx
  allocation fails. Convert to the goto teardown pattern as well.

Fixes the following dEQP-VK tests:
  dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail
  dEQP-VK.api.object_management.alloc_callback_fail.device
  dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <!12481>
59 jobs for !12481 with tu-alloc-failure-fixes in 18 minutes and 49 seconds (queued for 9 seconds)
latest detached
Status Name Job ID Coverage
  Sanity
passed sanity #12988653

00:00:09

 
  Container
passed debian/arm_build #12988656
aarch64

00:00:15

passed debian/x86_build-base #12988654

00:00:13

passed debian/x86_test-base #12988655

00:00:14

passed fedora/x86_build #12988657

00:00:11

passed windows_build_vs2019 #12988658
windows shell 1809 mesa

00:00:09

 
  Container 2
passed debian/android_build #12988663

00:00:12

passed debian/i386_build #12988660

00:00:13

passed debian/ppc64el_build #12988661

00:00:13

passed debian/s390x_build #12988662

00:00:14

passed debian/x86_build #12988659

00:00:13

passed debian/x86_test-gl #12988664

00:00:13

passed debian/x86_test-vk #12988665

00:00:13

passed kernel+rootfs_amd64 #12988666

00:00:14

passed kernel+rootfs_arm64 #12988667
aarch64

00:00:11

passed kernel+rootfs_armhf #12988668
aarch64

00:00:10

 
  Build X86 64
passed debian-clang #12988675

00:04:29

passed debian-clover #12988676

00:01:38

passed debian-clover-testing #12988671

00:01:48

passed debian-gallium #12988672

00:03:04

passed debian-release #12988673

00:03:34

passed debian-testing #12988669

00:02:02

passed debian-testing-asan #12988670

00:02:26

passed debian-vulkan #12988677

00:01:15

passed fedora-release #12988674

00:01:16

 
  Build Misc
passed debian-android #12988679

00:01:07

passed debian-arm64 #12988681
aarch64

00:02:18

passed debian-arm64-asan #12988682
aarch64

00:02:53

passed debian-arm64-build-test #12988683
aarch64

00:01:23

passed debian-armhf #12988680
aarch64

00:01:32

passed debian/arm_test #12988678

00:01:44

passed debian-i386 #12988684

00:02:18

passed debian-mingw32-x86_64 #12988685

00:02:01

 
  Freedreno
passed a306_gl 1/5 #12988686
google-freedreno-db410c

00:07:17

passed a306_gl 2/5 #12988687
google-freedreno-db410c

00:07:25

passed a306_gl 3/5 #12988688
google-freedreno-db410c

00:07:19

passed a306_gl 4/5 #12988689
google-freedreno-db410c

00:07:04

passed a306_gl 5/5 #12988690
google-freedreno-db410c

00:07:07

passed a306-traces #12988691
google-freedreno-db410c

00:02:38

passed a530_gl 1/5 #12988692
google-freedreno-db820c

00:07:44

passed a530_gl 2/5 #12988693
google-freedreno-db820c

00:08:01

passed a530_gl 3/5 #12988694
google-freedreno-db820c

00:08:08

passed a530_gl 4/5 #12988695
google-freedreno-db820c

00:08:24

passed a530_gl 5/5 #12988696
google-freedreno-db820c

00:07:24

passed a530_piglit_shader 1/2 #12988697
google-freedreno-db820c

00:07:59

passed a530_piglit_shader 2/2 #12988698
google-freedreno-db820c

00:08:54

passed a530-traces #12988699
google-freedreno-db820c

00:08:25

passed a630_egl #12988704
google-freedreno-cheza

00:02:05

passed a630_gl 1/4 #12988700
google-freedreno-cheza

00:05:16

passed a630_gl 2/4 #12988701
google-freedreno-cheza

00:06:14

passed a630_gl 3/4 #12988702
google-freedreno-cheza

00:04:51

passed a630_gl 4/4 #12988703
google-freedreno-cheza

00:05:38

passed a630_piglit #12988708
google-freedreno-cheza

00:08:20

passed a630-traces #12988709
google-freedreno-cheza

00:04:38

passed a630-traces-performance #12988711
google-freedreno-cheza manual

00:07:32

passed a630-traces-restricted #12988710
google-freedreno-cheza

00:03:53

passed a630_vk 1/3 #12988705
google-freedreno-cheza

00:07:41

passed a630_vk 2/3 #12988706
google-freedreno-cheza

00:08:59

passed a630_vk 3/3 #12988707
google-freedreno-cheza

00:09:08