Guthrie, Charles John, Lord Guthrie, Scottish judge