Under certain conditions we decrement the `__count` attribute too often, which can result in `onInteractionScheduledWorkCompleted` being called prematurely and/or more than once for a given interaction.

- [x] Track interactions scheduled during (sync) render phase.
- [x] Do not double-decrement suspense loads within a sync render.
- [x] Do not decrement sync commits that are waiting on suspense when the `Placeholder` is past its expiration.
- [x] Properly decrement pending interaction count when a suspense resource loads before its placeholder is shown.
- [x] Add test with high priority render between suspended and resolved suspense states (for both sync and async rendering)
function dispatch(
  sourceFiber: Fiber,
  value: mixed,
  expirationTime: ExpirationTime,
) {
  invariant(
    !isWorking || isCommitting,
    'dispatch: Cannot dispatch during the render phase.',
  );
  let fiber = sourceFiber.return;
  while (fiber !== null) {
    switch (fiber.tag) {
      case ClassComponent:
      case ClassComponentLazy:
        const ctor = fiber.type;
        const instance = fiber.stateNode;
        if (
          typeof ctor.getDerivedStateFromCatch === 'function' ||
          (typeof instance.componentDidCatch === 'function' &&
            !isAlreadyFailedLegacyErrorBoundary(instance))
        ) {
          const errorInfo = createCapturedValue(value, sourceFiber);
          const update = createClassErrorUpdate(
            fiber,
            errorInfo,
            expirationTime,
          );
          enqueueUpdate(fiber, update);
          scheduleWork(fiber, expirationTime);
          return;