Simplify buffer limit checking, and reuse BIO_snprintf returned value.