Allow the VT tests to run on OSX
Factor out into a function the current number of PTY's detection code
Merge pull request #14389 from s0undt3ch/hotfix/osx-pyt-nr

Allow the VT tests to run on OSX