feat($resource): Allow functions in action timeout

Support functions when configuring actions. This allows the timeout to change with time, when the function returns a number, and allows an action to be cancelled multiple times, when the function returns a new promise.

Closes #7974
This is the core of the PR. If you want to cancel an `$http` call you must specify a number or promise.

If you which to use a promise, you can only resolve it once. Adding a function as a valid timeout parameter allows us to return an unresolved promise each time. This is specially relevant with `$resource`.

This test tests if that approach actually works by using $timeout as a "promise provider" that gets resolved each time.