### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Electron Version

12.0.0

### What operating system are you using?

macOS

### Operating System Version

MacOS 10.15.7

### What arch are you using?

x64

### Last Known Working Electron version

10.4.7

### Expected Behavior

When a proxy has bad authentication, it should retry auth until it hits ERR_TOO_MANY_RETRIES, which is after the 32nd auth attempt

### Actual Behavior

On Mac x64: App crashes with SIGBUS or SIGSEGV before getting to ERR_TOO_MANY_RETRIES, crashes as early as after the very first attempt, this happens on all stable versions starting at 11.0.0 and newer, but seems to happen even on 10.x.y sometimes but not very often

On Windows x64: Instead of crashing, the browser window and seems to freeze, and no events related to proxy auth are triggered, but when the window is closed all the events that should have taken place are triggered as if they happened normally. This happens on all stable versions starting at 12.0.0 and newer

### Testcase Gist URL

https://gist.github.com/932efd0659efbb199e911d163c225565

### Additional Information

_No response_
shell/browser/login_handler.cc
const net::AuthChallengeInfo& auth_info,
    content::WebContents* web_contents,
    bool is_main_frame,
    const GURL& url,
    scoped_refptr<net::HttpResponseHeaders> response_headers,
    bool first_auth_attempt,
    LoginAuthRequiredCallback auth_required_callback)
    : WebContentsObserver(web_contents),
      auth_required_callback_(std::move(auth_required_callback)) {
  DCHECK_CURRENTLY_ON(BrowserThread::UI);
  base::SequencedTaskRunnerHandle::Get()->PostTask(
      FROM_HERE,
      base::BindOnce(&LoginHandler::EmitEvent, weak_factory_.GetWeakPtr(),
                     auth_info, is_main_frame, url, response_headers,
                     first_auth_attempt));
}
void LoginHandler::EmitEvent(