lib/util: Add functions to escape log lines but not break all non-ascii