Fix seg fault crash during device scale factor change

If the device scale factor of a layer changes while it is undergoing a
transform animation, it may result in a crash. This is because during a
device scale factor change operation, all transform animations are
cancelled leading to a call being made to animation observers of the
transform animation. The observers can then delete the layer or some
other layer in the hierarchical traversal. This can result in a seg
fault crash.

Bug: 987300
Test: Added unit test for the crash.
Change-Id: I8842e4b39daf59e4068497a3d662fda7f921b729
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1757126
Reviewed-by: Scott Violet <[email protected]>
Commit-Queue: Malay Keshav <[email protected]>
Cr-Commit-Position: refs/heads/master@{#688360}
2 files changed