The stupid thing is that there will always be a "Jack Bauer Exception." If the "never gonna happen" ticking time bomb scenario happens AND some agent has actually captured the terrorist with the codes and location of said bomb (god this is absurd) AND that agent determines that by playing a little smacky face he can get the information AND that this actually, you know, works, then either because no jury would convict or because the president could pardon someone they'd get off or whatever.
Of course that absurd situation will never actually happen so we don't have to bother thinking about it.