Magnetic fields and ionized gas in the local group irregular galaxies IC 10 and NGC 6822