GlES2: Add NULL check

Check for NULL before calling thread specific glGetString.

CRs-fixed: 569609

Change-Id: Ifee8257152ba7ca7a05df5d7b113171b71d16c82
(cherry picked from commit 79401f6ce898c7078df75cb89a314d5bd3e551c1)
surfaceflinger: Set max acquired buffer count

If triple framebuffers are enabled, the number of acquired
buffers isn't increased by default. Set the count to one less
than the max buffers to make sure all three buffers come into
play.

Change-Id: I65054ed4004607f5be68c893f6f621e821cfbf1c
(cherry picked from commit 92d3d27d9a9d0c853a82fba9f86dcb19ac9f4888)