Avoid adding to root when parent is destroyed

The move of addToRoot resolution left a behavior change that we now
would allow the layer being added to root if its initial parent is
destroyed between queuing the layer creation transaction and actual
handling of it in the main thread.

Bug: 204204635
Test: atest SurfaceFlinger_test
Test: atest libsurfaceflinger_test
Change-Id: I2f5b30cbe6fc579540a673af22ad41e248ae25c9
1 file changed