Added NULL check to BN_clear() & BN_CTX_end()