Use scheduleFinally for pending variable changes (#11707)

Change-Id: Ie87f0042823731a4a3ab5a10e3c23eb62ce57f37