glapi: Avoid heap corruption in _glapi_table

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
(cherry picked from commit ff5456d1acf6f627a6837be3f3f37c6a268c9e8e)
darwin: Fix test for kCGLPFAOpenGLProfile support at runtime

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 7a109268ab5b3544e7f7b99e84ef1fdf54023fb4)
appleglx: Improve error reporting if CGLChoosePixelFormat() didn't find any matching pixel formats.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 002a3a74273b81dfb226e1c3f0a8c18525ed0af4)
darwin: Write errors in choosing the pixel format to the crash log

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 9eb1d36c978a9b15ae2e999c630492dfffd7f165)
darwin: Guard Core Profile usage behind a testing envvar

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 04ce3be4010305902cc5ae81e8e0c8550d043a1e)