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
Graphics:Add error check when create GraphicBuffer

Big thanks to steven676 who found this commit to fix
graphics issues on many devices

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
Merge "Graphics:Add error check when create GraphicBuffer" into kk4.4
Merge remote-tracking branch 'Slim/kk4.4' into slim4.4