data-sort: move file removal out of lock