Peru’s president resigns on eve of impeachment