Libertarian secures electoral reform after his most difficult week since becoming Argentina’s president