Added atomic flush and set capability to cache.py
Added atomic flush and set capability to cache.py

The idea is that we give this method a dictionary that is meant to replace the whole contents of the previous cache. For consistency reasons it is all done atomically.
Phantasus/intelmq,aaronkaplan/intelmq-old,s4n7h0/intelmq,aaronkaplan/intelmq-old,aaronkaplan/intelmq-old