t5400: avoid concurrent writes into a trace file