Algeria's Bouteflika resigns after weeks of protests