Early indications suggest the Republic of Ireland has voted to legalise same-sex marriage in a historic referendum.