Graphics:Add error check when create GraphicBuffer

Change-Id: Ib0ca59bf1dfe4ae0266c29c91c1dbe3d02c0904e
Author: Lingyun Zhu <lingyun.zhu@intel.com>
Signed-off-by: Lingyun Zhu <lingyun.zhu@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 50141
sf: Fix detection of 0.3 hwcomposer

The format was different, so look at the header bits too...

Change-Id: Ibc3d4c9f6bca74d6951041f92e2ecc6189e58c41
Merge https://github.com/AOSP-S4-KK/platform_frameworks_native into kk-4.4