General Petraeus quits CIA over affair