[ConfigManager] Fix a problem that ignores --foreground option.

The reason is why the command line option cannot be gotten
before ConfigManager::reset() is called.