fix(browser): exit gracefully when the browser disconnects during cancellation (#10962)