base1: Add cockpit.reject() utility function
base1: Add cockpit.reject() utility function

This creates a new defered, rejects it, and returns its promise.
Used from within .then() callbacks. A solid alternative to
accepting thrown exceptions as rejections.

Closes #4277
Reviewed-by: Peter <a316049dd34607c62d4611d63ab22a6454add223@redhat.com>

matobet/cockpit,larsu/cockpit,larskarlitski/cockpit,mareklibra/cockpit,michalskrivanek/cockpit,cockpituous/cockpit,moraleslazaro/cockpit,larskarlitski/cockpit,Scribery/cockpit,arilivigni/cockpit,mareklibra/cockpit,xhad/cockpit,cockpit-project/cockpit,dperpeet/cockpit,michalskrivanek/cockpit,matobet/cockpit,xhad/cockpit,deryni/cockpit,arilivigni/cockpit,moraleslazaro/cockpit,Scribery/cockpit,sgallagher/cockpit,deryni/cockpit,vanloswang/cockpit,michalskrivanek/cockpit,SotolitoLabs/cockpit,deryni/cockpit,xhad/cockpit,cockpit-project/cockpit,deryni/cockpit,Scribery/cockpit,moraleslazaro/cockpit,dperpeet/cockpit,harishanand95/cockpit,sgallagher/cockpit,larskarlitski/cockpit,mvollmer/cockpit,petervo/cockpit,arilivigni/cockpit,moraleslazaro/cockpit,cockpit-project/cockpit,vanloswang/cockpit,deryni/cockpit,SotolitoLabs/cockpit,dperpeet/cockpit,larsu/cockpit,andreasn/cockpit,larsu/cockpit,garrett/cockpit,mareklibra/cockpit,arilivigni/cockpit,moraleslazaro/cockpit,mvollmer/cockpit,moraleslazaro/cockpit,SotolitoLabs/cockpit,petervo/cockpit,mvollmer/cockpit,martinpitt/cockpit,petervo/cockpit,cockpituous/cockpit,vanloswang/cockpit,andreasn/cockpit,moraleslazaro/cockpit,michalskrivanek/cockpit,andreasn/cockpit,martinpitt/cockpit,mareklibra/cockpit,garrett/cockpit,harishanand95/cockpit,xhad/cockpit,petervo/cockpit,stefwalter/cockpit,xhad/cockpit,larskarlitski/cockpit,larsu/cockpit,cockpit-project/cockpit,michalskrivanek/cockpit,mareklibra/cockpit,Scribery/cockpit,vanloswang/cockpit,stefwalter/cockpit,sgallagher/cockpit,arilivigni/cockpit,matobet/cockpit,larskarlitski/cockpit,cockpituous/cockpit,stefwalter/cockpit,larskarlitski/cockpit,mvollmer/cockpit,stefwalter/cockpit,michalskrivanek/cockpit,stefwalter/cockpit,stefwalter/cockpit,matobet/cockpit,petervo/cockpit,cockpituous/cockpit,deryni/cockpit,dperpeet/cockpit,martinpitt/cockpit,mareklibra/cockpit,arilivigni/cockpit,dperpeet/cockpit,martinpitt/cockpit,cockpit-project/cockpit,harishanand95/cockpit,mvollmer/cockpit,sgallagher/cockpit,andreasn/cockpit,cockpituous/cockpit,dperpeet/cockpit,Scribery/cockpit,petervo/cockpit,larsu/cockpit,dperpeet/cockpit,andreasn/cockpit,matobet/cockpit,sgallagher/cockpit,stefwalter/cockpit,sgallagher/cockpit,vanloswang/cockpit,andreasn/cockpit,Scribery/cockpit,harishanand95/cockpit,larskarlitski/cockpit,garrett/cockpit,harishanand95/cockpit,garrett/cockpit,cockpituous/cockpit,vanloswang/cockpit,harishanand95/cockpit,harishanand95/cockpit,andreasn/cockpit,xhad/cockpit,xhad/cockpit,SotolitoLabs/cockpit,SotolitoLabs/cockpit,deryni/cockpit,larsu/cockpit,petervo/cockpit,sgallagher/cockpit,matobet/cockpit,mareklibra/cockpit,Scribery/cockpit,SotolitoLabs/cockpit,arilivigni/cockpit,garrett/cockpit,michalskrivanek/cockpit,SotolitoLabs/cockpit,vanloswang/cockpit,martinpitt/cockpit