Disable non-blocking I/O for stdout, stderr (#1769)

* Disable non-blocking I/O for stdout, stderr

* Reduce to minimum

* Disable non-blocking for stderr too
diff --git a/.travis.yml b/.travis.yml
index 3f0c780..62c1898 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,6 +14,11 @@
   - osx
   - linux
 
+before_install:
+  # Disable non-blocking I/O for stdout, stderr https://github.com/travis-ci/travis-ci/issues/4704#issuecomment-348435959
+  - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
+  - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stderr, fcntl.F_GETFL); fcntl.fcntl(sys.stderr, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
+
 branches:
   only: [master]
 cache: