Call invalidate_fd in disconnect_and_raise, Use rb_warn instead of fprintf(stderr...)