Use nsIWebProgress to watch for bad cert status warnings.

These aren't visible through the http-on-modify-response path, so we need a
different observer.

We also don't need onSecurityChange at all. onStateChange for REQUEST is
sufficient.
Cosmetic improvements to Mike's patch:

 - avoid complex indentation
 - delete the API hook that we aren't using
Add a submission parameter to say whether there was a cert warning
Merge branch 'bad-cert-observer-rebase'