builddir: Replace usages of asprintf with string_format
builddir: Replace usages of asprintf with string_format

This simplifies the code and removes the need to manually allocate
memory on the heap.

Change-Id: I94bdda047530b9d64a26cbaee91eeea2d430eeb3
Reviewed-by: Scott Parlane <85029adc3fa41ef14594a57826619713bfe95f25@alliedtelesis.co.nz>
Reviewed-by: Ridge Kennedy <c60c433c4c1ae237d133641099200771ff6f6f30@alliedtelesis.co.nz>
Signed-off-by: Matt Bennett <e3d8681cec70d3da741935b3385821001b249adc@alliedtelesis.co.nz>

ATL-NZ/buildsyspp,alliedtelesis/buildsyspp