title: sys.stdout.write in python not working as expected
body: <p>Consider the following code snippet</p>
  
  <pre><code>#!/usr/bin/python3
  
  import sh
  import sys
  
  sys.stdout.write("hello")
  sh.whoami(_out=sys.stdout.buffer)
  </code></pre>
  
  <p>I expect the above program to print </p>
  
  <pre><code>hello
  username
  </code></pre>
  
  <p>but instead i get</p>
  
  <pre><code>username
  hello
  </code></pre>
  
  <p>Can anyone please explain me why this is happening? I am using python 3.5.2 on linux mint 18.1</p>