The Church of Scotland’s highest law-making body has voted to allow its ministers to be in same-sex marriages.