Prevent a crash by ensuring that there is a valid negotiated version.

Issue discovered by Joonas Kuorilehto of Codenomicon.
When assigning the TLS version, double check that it is valid.
check for correct error codes in print_extensions().
gnutls_x509_crt_get_extension_data: will return zero if data is NULL and memory buffer size is not sufficient.
Do not allow null strings to be read from ASN.1 structures.

This corrects a null pointer dereference when parsing some specially
crafted certificates. Issue discovered using the Codenomicon TLS
test suite.
doc update