Copy pseudotty disable code from Google
Merge pull request #689 from caskdata/feature/disable-pseudotty

COOPR-538 Copy pseudotty disable code from Google