Save config file atomically