removeReasonId = reasonId => {
    mapDelete(idToReason, reasonId);
    if (cancelChecking && idToReason.size === 0) {
      // No more unhandled rejections to check, just cancel the check.
      cancelChecking();
      cancelChecking = undefined;
    }
  }
Track a rejected promise and its corresponding reason if there is no
rejection handler synchronously attached.

@param {unknown} reason
@param {Promise} pr