Add missing lock for animation tasks.