query.cc: Avoid creating temporary string objects when appending a