Fix redownload files bigger than the cachesize

Added some tests and the fix in this commit. This is the actual diff of the PR https://github.com/stefanschneider/cacheddownloader/commit/74ecaf1539d393ad43afa96534b369692532df71

Even though it is based on the windows support commits, it is not related to the widndows support. 
This can be reproduced when running an executor with cache size 0 (or some small value) and then the second push will fail.

Windows tests are also passing for this fix: https://gist.github.com/stefanschneider/b98df4623129be0b274d