In historic referendum, Cuba legalizes same-sex marriage