Fix crash when calling --dump-config with failing set_options

It appears that our cleanup code hits an assertion failure when we have been called with --dump-config and a set of options that fails in set_options().