Don't call BIO_number_{read|written} on NULL BIOs. OpenSSL doesn't document the behaviour of these functions when given a NULL BIO, and it happens to return zero at the moment. But don't depend on that. Closes: #406 (cherry-picked)