Double charge-exchange scattering of pions by 51V and 90Zr in the resonance region