Avoid overly long lags, recover if system too slow.

This will recover better if the system took too long.  Also, fixes #6415
by never waiting too long.
Merge pull request #6420 from unknownbrackets/lagsync

Avoid overly long lags, recover if system too slow