There are two ways to prevent Chief Hanlon from committing suicide or from having to kill him yourself. The first way is to turn a blind eye to his wrongdoing. He'll continue to fabricate intel to confuse the NCR with no one knowing. The other way, and what I consider to be in line with the morals of the NCR Rangers, is to kill Caesar before confronting Hanlon. While this is no easy task, if you like Hanlon as a character and want to keep him as leader of the NCR Rangers without feeling that he's compromised, this is the best solution.