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
surfaceflinger: Apply bugfixes to the correct hwc code paths

Patches to deal with corner-case layer states were mistakenly merged into
the pre-1.0-hwc code paths. Move them to their intended locations

thanks ricardo for the correction

Change-Id: I64ca0fa2ef975c3a9e8f09dc15d3ce49b92d86b7
Merge remote-tracking branch 'slim/kk4.4-caf' into ose-caf