Fix malformed UTF-8 going to query profiler

Bug: 69926
Change-Id: I1c2e3f22104792fbc59491b1c6a17f2a6a0dd0b6
Merge "Fix malformed UTF-8 going to query profiler"