Safely run angular's scope.$apply()