Ulrik Gottlieb Ehrenbill (1733-1792), landshövding