hardware: qcom: sm8150: display: fix -Wreturn-stack-address

The return value of CompManager::StringDisplayList returns a pointer to
a local variable, whose lifetime ends at the end of that method. Fix
this by returning a std::string that will be copied (unless NRVO'd), and
pulling out the c_str() only when necessary.

Bug: 139945549
Test: mm
Merged-in: I4f42352dce12d2ce1cd4269b20b8c979d2bdabc3
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
(cherry picked from commit f3834b95b0eb0055f162c680205c6539d3187f65)
Change-Id: Ia0a3961f8a3d8334bc44fdb42921ae4dc16fcef7
2 files changed