This is a continuation of the r310302.
If KN_INFLUX | KN_SCAN flags are set for the note passed to knote() or knote_fork(), i.e. the knote is scanned, we might erronously clear INFLUX when finishing notification. For normal knote() it was fixed in r310302 simply by remembering the fact that we do not own INFLUX, since there we own knlist lock and scan thread cannot clear INFLUX until we drop knlist lock.
For knote_fork(), the situation is more complicated. We must drop knlist lock AKA the process lock, since we need to register new knotes. As result, the bug is more involved.
I see two ways to fix this. One is to do something with KN_SCAN, e.g. delegating the knote() operation to the scan thread, when the knote() sees KN_INFLUX | KN_SCAN. This is somewhat big change.
Another solution is to change KN_INFLUX into counter. It is quite simple, the drawback there is that the change is not KBI backward-compatible. But I think that this is the natural solution, and there might appear more situations where we want to distinguish exclusive ownership of knote for drop vs. shared ownership for some non-destructive manipulations. Note that added assert about kn_influx == 1 in knote_drop() verifies that influx state is not shared when knote is destroyed.
Patch also makes the knlist_destroy() function just assert the right condition instead of allowing it and printing a message, which is useless for user. This will be committed separately.