Clean up chpl_format() a little bit.

[Patch by Greg and Mike; review by Mike and Greg.]

This commit was primarily intended to address a coverity gripe (CID
1212420), namely the missing va_end() call.  It adds that.  While here,
I also improved the vsnprintf() call by removing the dependence on the
explicit element count with which the receiving buffer was declared and
the potential waste of the last byte of that buffer.  Mike reviewed the
result, spotted that the test of the vsnprintf() return value was wrong,
and wrote a corrected version.  I reviewed that correction.

It was sort of a time-shared form of pair programming.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23598 3a8e244f-b0f2-452b-bcba-4c88e055c3ca