egl: dri2_teardown_drm: fix segfault

It can happen that e.g. _eglAddDevice(..) fails and cleanup gets executed.

Program received signal SIGSEGV, Segmentation fault.
0xb6cf3d18 in gbm_device_destroy (gbm=0x0) at ../../src/gitlab_mesa/src/gbm/main/gbm.c:109

0  0xb6cf3d18 in gbm_device_destroy (gbm=0x0) at ../../src/gitlab_mesa/src/gbm/main/gbm.c:109
1  0xb6fb92b8 in dri2_teardown_drm (dri2_dpy=0x8627e0) at ../../src/gitlab_mesa/src/egl/drivers/dri2/platform_drm.c:792
2  0xb6fb449a in dri2_display_destroy (disp=0x862150) at ../../src/gitlab_mesa/src/egl/drivers/dri2/egl_dri2.c:954
3  0xb6fb9230 in dri2_initialize_drm (drv=0x862720, disp=0x862150) at ../../src/gitlab_mesa/src/egl/drivers/dri2/platform_drm.c:784
4  0xb6fb4334 in dri2_initialize (drv=0x862720, disp=0x862150) at ../../src/gitlab_mesa/src/egl/drivers/dri2/egl_dri2.c:884
5  0xb6fb0b42 in _eglMatchAndInitialize (disp=0x862150) at ../../src/gitlab_mesa/src/egl/main/egldriver.c:73
6  0xb6fb0ba4 in _eglMatchDriver (disp=0x862150) at ../../src/gitlab_mesa/src/egl/main/egldriver.c:94
7  0xb6fa85f8 in eglInitialize (dpy=0x862150, major=0xbefff9b0, minor=0xbefff9ac) at ../../src/gitlab_mesa/src/egl/main/eglapi.c:612

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
10 jobs for !1182 with egl-teardown-fix in 11 minutes and 8 seconds (queued for 2 seconds)
latest detached
Status Job ID Name Coverage
  Containers Build
passed #381605
debian

00:00:17

 
  Build+Test
passed #381607
meson-clang

00:10:50

passed #381611
meson-clover

00:10:48

passed #381610
meson-main

00:05:05

passed #381606
meson-swr-glvnd

00:06:02

passed #381612
meson-vulkan

00:02:40

passed #381614
scons-llvm

00:04:11

passed #381613
scons-nollvm

00:03:44

passed #381608
scons-swr

00:05:43

passed #381609
scons-win64

00:06:49