Add SSL_SESSION_from_bytes.

Mirrors SSL_SESSION_to_bytes. It avoids having to deal with object-reuse, the
non-size_t length parameter, and trailing data. Both it and the object-reuse
variant back onto an unexposed SSL_SESSION_parse which reads a CBS.

Note that this changes the object reuse story slightly. It's now merely an
optional output pointer that frees its old contents. No d2i_SSL_SESSION
consumer in Google that's built does reuse, much less reuse with the assumption
that the top-level object won't be overridden.

Change-Id: I5cb8522f96909bb222cab0f342423f2dd7814282
Reviewed-on: https://boringssl-review.googlesource.com/5121
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c
index 2b1575b..6a57660 100644
--- a/ssl/t1_lib.c
+++ b/ssl/t1_lib.c
@@ -2181,7 +2181,7 @@
   EVP_CIPHER_CTX_cleanup(&ctx);
   p = sdec;
 
-  sess = d2i_SSL_SESSION(NULL, &p, slen);
+  sess = SSL_SESSION_from_bytes(sdec, slen);
   OPENSSL_free(sdec);
   if (sess) {
     /* The session ID, if non-empty, is used by some clients to detect that the