Fix write_plugin_config

Fixes write_plugin_config so that it writes out a new file, and not
appends to existing one.