Improve test for setting and retrieving window size

Will hopefully fix failure seen at https://travis-ci.org/pexpect/pexpect/jobs/12331940