fix(ngAnimate): defer DOM operations for changing classes to postDigest

When ngAnimate is used, it will defer changes to classes until postDigest.
Previously, AngularJS (when ngAnimate is not loaded) would always immediately
perform these DOM operations.

Now, even when the ngAnimate module is not used, if $rootScope is in the midst
of a digest, class manipulation is deferred. This helps reduce jank in
browsers such as IE11.

/CC @tbosch --- alternative/more general fix here

Closes #8234
Closes #9263
> why immediately? and why are we testing this only for svg?

This was the pre-existing behaviour of $animate without ngAnimate. It was originally tested for non-svg too, but tests got shuffled and removed because I realized the behaviour was inconsistent between the two versions, they haven't been entirely re-added yet.

I don't know why we decided the behaviour should be inconsistent between the two versions, but I don't want to break that unless people say it's okay