Fix missing varargs cleanup
The CHECK() macro may cause execution to skip down to the cleanup
tag. If this happens, it would mean that we never called va_end()
on "backup".
This patch reorganizes the code slightly to ensure that va_end()
is always called.