Use call with the promise instance rather than the window

Hey guys, the latest angular version (specifically the 1339c11e36d9b9d23b26b98e90b523ab99901cfe commit) breaks this because the then function isn't called on the promise but on window.

This should fix it by determining the right promise instance in addition to the then function.