Adolf Ludvig Ribbing (1765-1843), greve, konspiratör