Roger Ailes, the longtime Republican media guru, founder of Fox News and its current chairman, had some advice last year for then-Gen. David H. Petraeus.