chansaver: write pending changes upon destruction

It's possible to kill ZNC or unload the chansaver module right after
a mode change => the changes would never be written. This could be one
of the reasons people are still experiencing #674 with the latest and
greatest development version.