nmbug.js: Third attempt at robustly loading the dialog polyfill
It seems like onload is firing after the browser finishes *fetching*
the target, but before it finishes *parsing* the target. That's
giving me ReferenceErrors for dialogPolyfill. This new approach
attacks that directly, and just spins until dialogPolyfill has been
setup (with a bonus wait before using it, just for good measure). Not
very pretty, but more robust ;).
I also simplified the check that avoids reloading the polyfills.
Instead of looking at the document's head, I just check for
dialogPolyfill. If we've got native dialogs or dialogPolyfill, don't
bother (re)loading the polyfill scripts.