Prime Minister Recep Tayyip Erdogan wins the Turkish presidency, promising a "new era" as thousands of people celebrate on the streets of Istanbul.