Fix bug where _pty_size() returns unreasonable rows/cols in Emacs
Changelog re #956, fixes #956