Self-generated Magnetic Fields in Galactic Cooling Flows