Lawmakers in Pakistan's National Assembly elected Shehbaz Sharif as the country's new prime minister for the second time, as allies of imprisoned former premier Imran Khan shouted in protest.