When applying the "link rewrite" magic to the history page, we should prefetch all the labels we need, like we already do for watchlist and recentchanges.
LabelPrefetchHookHandlers is triggered by the ChangesListInitRows hook for watchlist and recentchanges. A similar hook, probably in HistoryPager, would be needed to do the same for history pages.