Add function to find max socket for select