data-sort: set fds to -1 while still holding a lock