Effect of the metal-insulator transition on the spin-glass interaction