fix($q): allow third-party promise libraries
fix($q): allow third-party promise libraries

For testing, it can be useful to overwrite `$q` with other promise
implementions, such as Bluebird + angular-bluebird-promises. This broke
in v1.6.x with "TypeError: Cannot set property 'pur' of undefined".

Closes #16164

Closes #16471

eistrati/angular.js,eistrati/angular.js,ze-pequeno/angular.js,eistrati/angular.js,angular/angular.js,reneploetz/angular.js,gkalpak/angular.js,ze-pequeno/angular.js,gkalpak/angular.js,ze-pequeno/angular.js,gkalpak/angular.js,mgol/angular.js,mgol/angular.js,reneploetz/angular.js,mgol/angular.js,eistrati/angular.js,mosoft521/angular.js,mosoft521/angular.js,mosoft521/angular.js,mosoft521/angular.js,angular/angular.js,reneploetz/angular.js,angular/angular.js,reneploetz/angular.js,mgol/angular.js,ze-pequeno/angular.js,gkalpak/angular.js,angular/angular.js