Check $$phase on the root scope

Checking $$phase on the directive scope is not good enough since $$phase is defined on the root scope.
If there's an isolated scope in the chain, it will break.