Change X509 extension value parsing to not abort on malloc failures.

Also comes with factoring that out in to it's own function and
additional error check before using a return value from BIO_pending.