Use select as default io wait function. Fix bug of child killed too fast