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.
server/upload.py: fix error when saving logs
build/create-image.sh: fix build for grub2 under RHEL7/CentOS7