How the once-reviled 18th-century libertine writer became France’s most decadent cultural hero.