Handle the case where the ioctl returns sizes == 0

This occurs in emacs shell buffers, for example, which don't report anything useful for size.
Merge pull request #62 from offbyone/fix-ioctl-size-returns-0

Handle the case where the ioctl returns sizes == 0