Close state file