Ensure that templates resolve pending instance by the end of the *current* microtask

R=arv
BUG=

Review URL: https://codereview.appspot.com/9802044