use writeSync instead of stdout.write to make sure that stream is flushed
Merge pull request #437 from Microsoft/flush_stdout

use writeSync instead of stdout.write to make sure that stream is flushed