[PATCH v6 19/27] util: fix interleaving of error & trace output