Bug 845842 - Use promises that resolve on later ticks; r=rnewman, a=bajaj

This is meant as a temporary workaround until a built-in promise library
offers similar functionality.