The function sprintf is generally considered unsafe to use in modern C. In the
Graphviz code base, its uses are slowly being replaced with safer alternatives
(#1950). However, the alternative code is frequently overly verbose and
counter-intuitive. This commit adds (hopefully) convenient alternative functions
that can be used to replace sprintf uses. The gv_sprint function is similar to
the GNU asprintf function with a different calling convention.
The tests added alongside follow the same strategy as used for testing
lib/vmalloc.