openssl: properly check return value when writing to BIO objects
In particular, we will read out of bounds, and then write the invalid memory, if BIO_write() fails when getting the PROP_CERTIFICATE_PEM property. Here we attempt to check the return value, but the check is not correct.
This also fixes a leak of the BIO in the same place.
Also add error checking to PROP_SUBJECT_NAME and PROP_ISSUER_NAME, for good measure.
Fixes #226 (closed)
Edited by Michael Catanzaro