Fix possible segv if NULL is passed as cert.

* src/cert.c (ksba_cert_get_digest_algo): Fix !cert case.
--

Found by Hans-Christoph Steiner with cppcheck.
tests: Fix warning about unused var.

* tests/t-dnparser.c (main): Drop unneeded var INPUTLEN.