How a historian of Iceland’s quirky politics became the country’s new president.