While kqueue_fork_copy_list() is iterating over the knote lists, the
backing array may change while the kqueue lock is dropped. Since each
list is a singly-linked list, kqueue_fork_copy_list() must start
iterating from the list head in order to remove the marker, but that
list head pointer is invalid after kqueue_expand() runs.
Add a bit of indirection to re-compute the correct list head each time
the kqueue lock is dropped.
Avoid changing the layout of struct knote since I want to backport this
to releng branches.
Reported by: Dennys Kaluzny Pereira <dennyskaluzny@gmail.com>