Merge "DO NOT MERGE: SF: Fix a race between layer creation and apply transaction"