Renewables overtook coal as the world's leading source of electricity this year, a think tank analysis shows.