qibuild test: fix output and lock management when not a tty.
qibuild test: fix output and lock management when not a tty.

Change-Id: I2f91cb5935fa0aed05c94bb06e0ed6fa2fef96b2

aldebaran/qibuild,aldebaran/qibuild,aldebaran/qibuild,aldebaran/qibuild,dmerejkowsky/qibuild,dmerejkowsky/qibuild,dmerejkowsky/qibuild,dmerejkowsky/qibuild,dmerejkowsky/qibuild