GlES2: Add NULL check

Check for NULL before calling thread specific glGetString.

CRs-fixed: 569609

Change-Id: Ifee8257152ba7ca7a05df5d7b113171b71d16c82
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
Surfaceflinger: Remove ifdef on GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE

https://github.com/CyanogenMod/android_frameworks_native/commit/e0c4ab43ce7a851ab5fefbd2e8e259daf1c48c68

The above revert commit brought the if (!useReadPixels) statement back in when it isn't
necessary.

Huge thanks to ankitkv for discovering this!

Change-Id: Ifceb27c836ad9c2d73f48127727ba5d2849e5daf
Merge remote-tracking branch 'cm/cm-11.0'; commit 'HEAD' into HEAD