elog: make elog_string() multi-thread safe