final fix for xsendfile zip generation race condition

This should completely address the race condition that can happen during zip generation already explained in #2491. 

This fix was suggested by @bartv in one of his last comments.