#4227 in upstream repo

Probable fix for #4227 by adding boolean pty option in ansible.cfg
I still think that any type of program crash is the issue. Even if some option helps avoid this.
Maybe the best solution is try to call get_pty() function and, if it fails, worked without them. But I can't figure out some neat exception.