plug memory leak when the rpmdb is found to be corrupt
fix a couple of minor problems found with cppcheck