Move flag_plugin_added out of invoke_plugin_callbacks.