Guard against animating unmounted component

If cmp is not mounted, setState will error.