Sven Erland Heurlin (1758-1827), District Count Judge