This function:
- Allocates a block of memory;
- Copies things into that block of memory;
- Allocates another block of memory inside nsAutoCString;
- Copies into our string from the block of memory we just allocated.
Clearly we can avoid a memory allocation and some copying by just
allocating the amount of data we need in the string first, and copying
things into the string.