bsdinstall partedit: Replace malloc + sprintf with asprintf
This avoids potential bugs with the length passed to malloc not
matching the string written via sprintf.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42238
(cherry picked from commit 51749e05e96eb07134a38984a8c06608b20f07ea)