Use a sliding window to track failures / successes

This will give better error rate reporting.
Since there are no return values or split code paths, there's no need to defer the unlock (and hit the performance penalty).  `Unlock()` can probably just go to the end of the function.