Rewrite TBSCertificate, using the new OpenSSL-1.0.2 API.

Tested with 1.0.2-beta3 and 1.0.1.
remove redundant check
Merge branch 'ekasper-102'