Simplify code in AWTSurfaceLock for CALayer support