Fix bug where _pty_size() returns unreasonable rows/cols in Emacs
Changelog re #956, fixes #956
Merge branch '1.5' into 1.6