Left-leaning politician Anura Kumara Dissanayake has won Sri Lanka's presidential election after a historic second round of counting.