I feel he knew, Gestahl was quick to spare Kefka's life. Even if you demand for him to be executed, Gestahl talks the Returners into waiting til the Esper situation has been resolved first before dealing with him. Kefka is too valuable to Gestahl since he's the only person in the Empire who seems to be completely privy to the Emperor's plans and is given a hell of a lot of leeway compared to the rest of his staff.

He had to jail Kefka to make the whole situation seem real to the Returners. You can't demand peace with a major war criminal on board. It should also be noted, that this is also the first time the player really got to see the Emperor first hand, beyond the short flashback Terra has at the beginning of the game, and Maduin's flashback. So, I feel locking Kefka up, was also suppose to lure the player into a false sense of security as well.