Just doubled performance of the ngscopeclient CDR PLL on some workloads by fixin...

@azonenberg@ioc.exchange

Just doubled performance of the ngscopeclient CDR PLL on some workloads by fixing a bug causing it to run twice.

The PLL starts out with a small output buffer (since it doesn't know how much it's oversampling the input) then if it needs to generate more clock edges than the buffer can hold will expand the buffer and re-run. The size of the previous output is saved so next time it can make a better estimate of how much to allocate.

This adaptive sizing step is supposed to run infrequently but a rounding error was causing it to run almost every refresh cycle, allocating a buffer a few percent too small then doubling it when the output didn't fit.