Vanghan, John, Sir, active 1800-1826, Judge