Bug 886498 - Obtain lock before writing to terminal; r=ted

DONTBUILD (NPOTB)