Dont wait for invalidation to finish if only one invalidation batch is n...

...ecessary, or, if more are necessary, for the last one

As discussed in #4.

At some point this project really needs some tests. :smiley: