lib/string_helpers.c: change semantics of string_escape_mem