Fix a problem where the server would go into a tight loop with select().