tls: fix session resumption check
Before checking server's identity call to OpenSSL internals to ensure that the session was not reused. In such case - certificate is going to be empty and validation will crash.
Fix: #2304 (closed)
P.S.
This is introducing big thing as a part of commit, which should probably be eventually exposed to user-land.
cc @nodejs/crypto