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
I don't understand what you are testing here. isn't this the same test as the one before but repeated twice? why would that matter?