My guess: the Chicago gang was using the affair to blackmail him and up until last week, he thought he could play along and still keep his job.
I noticed Barry & Co. were trying real hard to keep him from *having to* testify. Once he came clean though, he eliminated all of the blackmailers' leverage.
No proof, just giving voice to my suspicious nature. :-)