tls_generic_test sanitisation.

> I wouldn't like any crypto-code calling this tls_generic.c function for reporting errors.
Why not ?  Repeating the same piece of code over and over again serves no good purpose.