Write to configuration file when settings are changed.