Record the TIOCINQ ioctl.  Also improve logging and syscallbuf assertions.

Resolves #468.