kernel - kqueue select support
* Fix bug in kevent timeout handling. Only go to non-blocking once
(*res) is non-zero.
* Use stack-declared kfd_set structures for select operations on
64 or fewer descriptors.
* Refactor the select_copyin() loop.
* Fix bug in serial number decoding in the select_copyout() loop.
* Do not use EV_CLEAR, this can cause temporary EOF conditions to
reset improperly. Do not use EV_ONESHOT either. Leave the event
in the kqueue, it will speed things up when select() is called in
a loop (the events will already exist).
* Implement ptckqfilter ... implement kqfilter functions for pty's and
ptc's instead of using the tty kqfilter functions which do not work
properly for ptc control terminals.
* Change getbits/putbits from macros to inline functions.