patch to use write_config in non-rails contexts