properly count number of file descriptors for select