base: Repopulate rpmdb if empty

In some weird cases, the rpmdb is empty breaking the build.
In such case, let's try to repopulate it.

This bug seems to be related with the rpm running on the host while not
having a simple proof of why.