fix($animate): ensure animations work properly when the $rootElement is being animated

Closes #4397
Closes #4231