Backend: Don’t raise an exception if saving the config fails.
Frontend: exit nicely on SIGINT and SIGTERM.

Using SIG_DFL kills the process immediately, not saving the configuration.
Proper handling is required.
Merge pull request #323 from plietar/fix-signal

Improve configuration saving