McDowall, John, active 1780-1810, Ceylon public official