build: use plainTerminal for tests on Travis CI
Merge pull request #1609 from jszakmeister/use-plain-terminal-for-tests

build: use plainTerminal for tests on Travis CI
shell: Fix shell command output

Shell command output was broken in @8a5a8db, which refactored nvim to no longer
switch to cooked mode(linefeeds are processed differently).

Fix the problem by refactoring write_output to accept to extra arguments that
control the flushing behavior and where data will be written to: buffer or
raw editor screen.