Cleanup the config save code.
Use S_IRUSR|S_IWUSR consistently in open().
Prepare for the impossible.  Well, unlikely.

Use pid as part of the config save file.
Sanity check how the config_file looks like.