backend: really keep the batch of size MAX_IN_BATCH
And also fix the testsuite, it was failing from time to time:
> assert len(add - expected) == 1
E assert 0 == 1
E +0
E -1
The 'add_102' item from time to time wasn't inside the 'add' set, since
the set of taken tasks is randomized. Now the test should be more deep,
and deterministic.
With roughly the same probability we could get:
assert self.redis.hgetall(key) == {}
> assert len(caplog.record_tuples) == 3
E assert 2 == 3
E +2
E -3