This turns out to be required to produce correct metalog output.
While here,
- Don't rely on X509_NAME_oneline() if we can avoid it.
- Fix metalog output to be relative to DESTDIR.
- Rework the tests so they're agnostic to DISTBASE.
- Account for a recent change in openssl storeutl.
- Add several new tests.
Reported by: jrtc27, kp
Fixes: 81d8827ad875 ("certctl: Reimplement in C")