Fixes to CALayer optimizations for MacOS

This patch ensures that layers are rebuilt when a window changes scale (retina to
non-retina) on MacOS.

Also ensures that works on MacOS pre 10.14.
7 jobs for fix-shouldInheritContentsScale in 18 minutes and 44 seconds (queued for 1 minute and 39 seconds)
latest