Pull up following revision(s) (requested by maxv in ticket #1084):
	sys/compat/netbsd32/netbsd32_netbsd.c	rev. 1.187

Fix cases where count <= 0 (thanks to Maxime Villard for raising this).
Pull up following revision(s) (requested by maxv in ticket #1086):
        sys/compat/freebsd/freebsd_sched.c	1.20-1.21

Avoid NULL dereference and fix sched param conversion (at least make it
do something). Pointed out by Maxime Villard.

Simplify and clarify.
Ticket 1084 and 1086.
Pull up following revision(s) (requested by maxv in ticket #1090):
	sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.24
	sys/compat/netbsd32/netbsd32_event.c: revision 1.11
Allocate directly KQ_NEVENTS bytes. Otherwise a user can panic the system.
ok christos@
Ticket 1090.