How to save a compressed dictionary to a file