Print status when edge finishes on dumb terminals
Print status when edge finishes on dumb terminals

On smart terminals ninja prints the status line both before
and after running a command, reusing the same line if possible.
On a dumb terminal that doesn't support reusing the line, it
only prints the status before starting the command, but prints
the output of the command when the command finishes, by which
point other commands may have started and printed their status
line.  This makes it impossible to determine what command
produced a line of output.

Modify BuildEdgeStarted to only print the status line if the
command is going to lock the console, or if ninja is running
on a smart terminal.  Modify BuildEdgeFinished to always
print the status line unless the command locked the console,
in which case the status was already printed and no other
command can have printed any lines.

The end result will be dumb terminal output that much more
closely matches smart terminal output.  One disadvantage is
that dumb terminals won't show anything when starting a
command, making it harder to tell what commands are currently
running, but I expect most interactive uses of ninja will use
a smart terminal.

(cherry picked from commit a4751630cd6d2d753505a6fd222277cf2d99a135)
Change-Id: I97d7f6bcc9c0af45016a69b563f0f6243cc0eff4

mydongistiny/ninja,mydongistiny/ninja,mydongistiny/ninja,mydongistiny/ninja