Avoid breaking catch/finally on angular promises

Fixes cases where code like :
```js
$http(...)
  .then(...)
  .catch(...)
  .finally(...)
```
would end up looking like this :
```js
$http(...)
  .then(...)
  .
  catch(...)
  .
  finally(...)
```