Former intelligence chief Mustafa al-Kadhimi has been sworn in as the new prime minister.