db: execute privileged upgrade operation only if required

Having a privileged user during installation should be avoided. But in
this case it is required due to legacy, so avoid if we can.

Change-Id: I66da7066b26e9aa18df75e4a36e520c495a5880f
Signed-off-by: Alon Bar-Lev <alonbl@redhat.com>