the great lover casanova had once been a prisoner in the piombi ; charged by the inquisition with adultery and spying , he had survived fifteen months of incarceration only to escape by beguiling his keeper .