Move promise resolved flag checking/setting.

This moves the checking and subsequent setting of the resolved flag from `fulfill`, `reject`, and `resolve` to the internal fulfill, reject, and resolve algorithms. This is more resilient in the face of malicious thenables, which as currently specified can cause multiple fulfillment, multiple rejection, or any combination thereof.

Fixes http://lists.w3.org/Archives/Public/www-dom/2013AprJun/0283.html