Fix crash when changing non-cached source of image during animation

Ensure deferred deletions are handled while syncing, otherwise texture
might be deleted after sync but before deferred deletion is processed.

Task-number: QTBUG-32513
Change-Id: Id276f536a5722a36baae815b7b550b574eeeb483
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Delay calculation of offline storage path as long as is practically possible.

This avoids calculating it incorrectly in the case that something later clobbers
argv, such as a zygote or booster-type mechanism.