move db out of runtime conf structure

Because the metrics database is not a runtime configuration parameter,
it should better be a global variable on itself.
more checking of errors from whisper functions

Check if error is returned by whisper functions whisper_read_metadata()
and whisper_read_archive_info().