[snapshot/restore] Refactor failure counter in MockRepository