radv: Check that the master_fd actually is a master.

Since 8059add04 "drm: allow render capable master with DRM_AUTH ioctls" in
the kernel, the assumption that the fd from a primary node that is working
for rendering is a master fd, is not true anymore.

This causes issues in that if we already have a "master fd", leases stop
working as it only allows 1 master fd for the wsi.

This open codes drmIsMaster because I don't think we should bump libdrm
requirements in backports.

Fixes: 451b58a5 "radv: Add KHR_display extension to radv [v5]"
14 jobs for !669 with master-check in 14 minutes and 21 seconds (queued for 4 seconds)
detached
Status Job ID Name Coverage
  Containers Build
passed #242451
debian

00:01:37

 
  Build+Test
passed #242453
meson-clang

00:12:43

passed #242459
meson-gallium-clover-llvm

00:07:11

passed #242460
meson-gallium-clover-llvm39

00:05:04

passed #242458
meson-gallium-drivers-other

00:09:13

passed #242457
meson-gallium-radeonsi

00:06:07

passed #242461
meson-gallium-st-other

00:07:09

passed #242452
meson-gallium-swr

00:10:12

passed #242456
meson-glvnd

00:04:33

passed #242455
meson-loader-classic-dri

00:07:31

passed #242454
meson-vulkan

00:02:41

passed #242463
scons-llvm

00:06:34

passed #242462
scons-nollvm

00:04:32

passed #242464
scons-swr

00:08:01