Flush whether or not there we set the rawmode to avoid the client to lock
Flush stdout on import to avoid deadklock when waiting for stdin (import -). Fixed #365
Merge remote-tracking branch 'origin/fix_flush_behaviour'