refactor(HMR clients): Encapsulate some of the turbopack state tracking into a shared TurbopackHmr class (#76994)
There are multiple bits of state that we must track in the Turbopack HMR client, so this groups them together into a single class.
The motivation here is that the next PR adds more state that we'd also like to encapsulate in the same place.