hax: Add back the SURFACE_SKIP_FIRST_DEQUEUE legacy EGL workaround

Set BOARD_EGL_SKIP_FIRST_DEQUEUE to use

Change-Id: I46257a7e9e6b6e093a5cb92eaaaef4bdd0435a12
Surface: Initialize variable and add a defensive check

Initialize buf variable and make sure to check for return
value of dequeueBuffer() before sending to the client.

Change-Id: I0569f2d45825fab0e5d0f38fc91a07990f57c7ab
(cherry picked from commit a6bd7106a7305208f187fbf0a48f14139e33c9d6)
(cherry picked from commit e5d7662d68c5be2b282edd58d4feb68a4d476182)
(cherry picked from commit 885c146144480d4371a0a97df89b8e77f53d3d94)
Check fence is not NULL before dereferencing it

If the fence obtained in dequeueBuffer is NULL, don't dereference it.
This will avoid a crash in surfaceflinger.

CRs-fixed: 516300
Change-Id: I3054dc37087103f3addae7884bb03460484a1eec
(cherry picked from commit ddf4adb487dc76ccb75fe2432772d6fc575ed77c)
(cherry picked from commit c6ae5271f9ced9a747e1481c2ef875ba03674172)
(cherry picked from commit cdad709878601eb694acbce7d3ae9f7a74bf14f3)
SurfaceFlinger: Add NULL check for buffer handling

Add buffer handling NULL check in dequeueBuffer and
verify whether the output data from binder is not NULL
in queueBuffer and connect api's to avoid SF crash

CRs-Fixed: 573088
CRs-Fixed: 572315

Change-Id: I41cebbc0cbcbbb0fd5ecb38db7ec7b0c91cdffe9
libgui: Add native window attributes to query usage

This is required to enable GL libraries to query usage
native window attributes to enable/disable tile rendering.

Change-Id: If752fa26ac3d8ffd7776cc5a16fe162af0742df5