Fix a race condition which could cause logcat files to be leaked

Essentially, the InvocationThread can run so quickly that it beats
LogcatReceiver thread to the synchronized(mLogcatReceiver) lock by
calling stopLogcat().  At that point, it cancels mLogcatReceiver.
The LogcatReceiver thread is inside run(), but hasn't yet run
createTmpFile(), which also requires the synchronized lock.  So once
the InvocationThread released the synchronized lock, _then_ the
LogcatReceiver thread enters createTmpFile and creates the
to-be-orphaned logcat file.  It writes the "Logcat for device..."
message to the output stream, but the thread exits well before the
message can be flushed to disk,

Bug: 4119044
Change-Id: Idc01b2301c50531a8b5288dcb5394d52e126deaa
1 file changed