Tunisians have elected retired law professor Kais Saied as president, rejecting the North African country’s old governing elite.