Electrical relaxation induced by magnetostriction in a MEMS device