check scope.$root.$$phase before $apply

I used the uiSelect2 directive in another directive with isolated scope, and this modification avoid "$digest already in progress" error.
Merge pull request #88 from bdecarne/patch-1

check scope.$root.$$phase before $apply