On <dialog> submission, don't dispatch the close event until we're done.

For <form method=dialog>, submitting causes the dialog to close, which
dispatches a 'close' event. But we shouldn't dispatch the event until
the form submission is complete, in case the event handler wants to
reopen and resubmit the dialog.

BUG=304827

Review URL: https://codereview.chromium.org/28803002

git-svn-id: svn://svn.chromium.org/blink/trunk@160058 bbb929c8-8fbe-4397-9dbb-9b2b20218538