The Thought Police presumably encountered Thought Criminals with at least some regularity. At a minimum, there were a fair number of people imprisoned at the Ministry of Love. With that said, how did they prevent themselves from becoming Thought Criminals too (given that they probably would've had to interact with whatever made the individuals thought criminals to begin with)?
They don't because they don't need to.
Neither in 1984 or in Orwell's memoirs are the inner workings of the Thought Police described in detail. Aside from stray comments about the selection of new agents, or how the upper classes would grow ever more fanatic in spite of their greater knowledge, it's unclear if the Thought Police would police their own ranks differently from that of the masses.
(Un)fortunately, we can look to the GRU former Soviet Union for a possible, clearer answer.
As Victor Suvorov in Aquarium relates:
That's it over there . . .' Grey-hair points to a fat square chimney, no more than ten metres high, built on top of a flat asphalt roof. The black roof floats among the greenery of the lilac bushes like a raft in the ocean or an oldfashioned battleship, sitting low in the water with its funnel quite out of proportion. A thin transparent smoke is rising from the chimney. 'Is that someone leaving the organization?' 'No.' Grey-hair laughs. 'The chimney is not only our way out; it is also a source of energy for us and the guardian of our secrets. At the moment they are simply burning secret papers. It's better, you know, to burn them than to keep them. When somebody leaves the organization the smoke is not like this; it is dense and oily. If you join the organization you too will one day rise into the sky through that chimney. But that's not what we're here for now. The organization is giving you a last chance to change your mind, a final opportunity to consider your choice. And to give you something to think about, I'll show you a film. Sit down.'
For most of the Cold War, the GRU operated out of Soviet Embassies in the West. Despite their numbers, the GRU was aware that the allure of the surrounding societies would eventually seduce at least few of its members.
So, instead of focusing on the beginning of betrayals (thought-crime), which would have been extremely costly and a poor use of resources (imagine surveilling your own surveillance everyday), the GRU instead focuses mainly on the end: first, by stating that all GRU officers will be cremated, and, second, betrayal simply moves that timeline up.
This means the organization expects a tiny percentage of its agents to go rogue and makes explicit the procedures to deal with it, to its agents
In Aquarium, unreliable or poorly performing agents are immediately sedated and shipped back on a plane to Moscow by their own comrades. Suvorov himself who assisted in said procedure narrowly escapes his own procedure towards the end.
In the context of 1984, we can say that the Thought Police will be generally more vigilant and more strict about what constitutes betrayal. Nonetheless, they will fundamentally approach it as the GRU did:
Betrayal will happen, and when it does, make sure the members of organization follow procedure: light the traitors on fire.
An Outer Party member has been told to believe that the Party is advancing the common good, and believes that this is what the Party should be doing. If he comes to believe that the Party, far from advancing the common good, is actually the chief obstacle to that desideratum, he becomes a threat to the Party.
On the other hand, a Thought Police apparatchik already knows that it's really all about power, and is perfectly happy with that, because in some way he's cashing in on that situation and could not care less about the common good. His disillusionment is not a threat to the Party because his loyalty does not depend on the illusion.