mesa: return NULL if we exceed MaxColorAttachments in get_fb_attachment

This fixes invalid access to Attachment array which would occur if caller
would exceed MaxColorAttachments. In practice this should not ever happen
because DiscardFramebufferEXT specifies only GL_COLOR_ATTACHMENT0 to be
valid and InvalidateFramebuffer will error out before but this should
make coverity happy.

v2: const, remove _EXT (Ian)

CID: 1442559
Fixes: 0c42b5f3 "mesa: wire up InvalidateFramebuffer"
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
24 jobs for cid-1442559 in 31 minutes and 24 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Build+Test
passed #122606
build:make-gallium-drivers-other

00:09:19

passed #122605
build:make-gallium-drivers-radeonsi

00:06:15

passed #122604
build:make-gallium-drivers-swr

00:09:57

passed #122607
build:make-gallium-st-clover-llvm-39

00:07:48

passed #122608
build:make-gallium-st-clover-llvm-4

00:06:30

passed #122609
build:make-gallium-st-clover-llvm-5

00:06:48

passed #122610
build:make-gallium-st-clover-llvm-6

00:06:38

passed #122611
build:make-gallium-st-clover-llvm-7

00:08:37

passed #122612
build:make-gallium-st-other

00:07:21

passed #122603
build:make-loader-classic-dri

00:08:54

passed #122602
build:make-vulkan

00:04:54

passed #122598
build:meson-gallium-clover-llvm5

00:03:40

passed #122599
build:meson-gallium-clover-llvm6

00:04:08

passed #122600
build:meson-gallium-clover-llvm7

00:03:38

passed #122597
build:meson-gallium-drivers-other

00:04:15

passed #122596
build:meson-gallium-radeonsi

00:03:12

passed #122601
build:meson-gallium-st-other

00:03:29

passed #122595
build:meson-gallium-swr

00:09:28

passed #122594
build:meson-glvnd

00:03:47

passed #122593
build:meson-loader-classic-dri

00:03:49

passed #122592
build:meson-vulkan

00:01:53

passed #122614
build:scons-llvm

00:05:04

passed #122613
build:scons-nollvm

00:03:31

passed #122615
build:scons-swr

00:05:43