Edward Maitland, Lord Barcaple — Scottish advocate and judge