Use Qpsmtpd::DB in karma plugin

And clean up a few things in Qpsmtpd::DB