core: [db] change db owner check from 'engine'

Check against the actual DB owner instead of 'engine'.

Change-Id: I7e9af94450c8f5a809c34a22ebe36d7a69d3e865
Signed-off-by: Eli Mesika <emesika@redhat.com>