rewrite configuration file if file exists when freezing

Hi, 
I really liked tmuxp. I customized it to rewrite the configurations which I felt it would be useful.
All settings except the layout are kept. Also windows that gets closed disappears in the rewrite.