Close configuration file properly