Fix fd array corruption in iv_method_poll.
Fix fd array corruption in iv_method_poll.

When an fd which is not the last in the iv_method_poll fd array no
longer has any handlers associated with it, it is removed from the fd
array, and the last entry from the fd array is moved to the now empty
spot in the array.

But when we move the last entry into the empty spot, we should update
its ->index member, as its position in the fd array has changed -- but
this is something that we would forget to do.

This patch fixes that, and should fix the observed corruption of the
fd array.

Signed-off-by: Balazs Scheidler <c9ced0bffa833fad400e0759f75a89a845bcc267@balabit.hu>
Signed-off-by: Lennert Buytenhek <8858498612e3a522354216649776e3032dcb7e5b@wantstofly.org>

buytenh/ivykis,buytenh/ivykis