KABUL, Afghanistan — Ending months of vote-related tension, Afghanistan's election commission named a new president Sunday only hours after the leading candidates signed a power-sharing deal that names one of them as the country's new chief executive.