A razor-thin majority of 50.17% voted "yes" in Moldova's pivotal referendum on joining the European Union.