fix select return EINTR

通过man select可以查看到select会返回EINTR when a signal was caught