fix all compile warnings, move to rb_thread_fd_select

now compiles without warnings