Make sure log streams are done before command returns

... thereby trying to fix the problem that periodicnoise sometimes does not kill a process after timeout.