select: add poll_select_set_timeout() and poll_select_copy_remaining() helpers