[Reviewer: Andy] Handle snprintf and vsnprintf values appropriately in the logger to avoi...

...d stack problems

Tested by running the Sprout UTs, both with MAX_LOGLINE at its normal value and reduced to 80 (which previously provoked a crash). Includes some speculative but untested fixes to backtrace logging - can you review those particularly carefully?

I only found one other snprintf in cpp-common - in utils.cpp, where we're formatting an IP address and I think there's no risk of overflow.
Why no truncate message here?  Possibly because we'd never expect to hit the limit?