sh: stacktrace: Properly terminate the trace entry buffer.