!UPSTREAM: mesa: Track number of layers in layered framebuffers.

In order to properly clear layered framebuffers, we need to know how
many layers they have.  The easiest way to do this is to record it in
the gl_framebuffer when we check framebuffer completeness, just like
we do for the Layered boolean.

TODO: split out the checking of attachment type.
!UPSTREAM: meta: fix meta clear of layered framebuffers

TODO:
- Improve commit message.
WIP: refactor blorp clearing code in preparation for adding layered clears
i965: Fix blorp clear of layered framebuffers.

Fixes piglit test "spec/!OpenGL 3.2/layered-rendering/clear-color".
i965: Fix fast clear of depth buffers.

Fixes piglit test "spec/!OpenGL 3.2/layered-rendering/clear-depth".