file ds: use renaming to reduce race conditions