Added untested code to ensure that Pond statefile writes occur atomically; i.e., writes occur to a temporary file without truncating it. In the event that writing fails, Pond will leave behind the old statefile. Not yet tested.