mod: More robust get_model and get_config_raw
mod: More robust get_model and get_config_raw

The unit test may reset the DB after modules are loaded, these changes
make us more tolerate to that.

Signed-off-by: Fam Zheng <df9fd617995bad07eac70e27aa3fe5069270e3bd@redhat.com>

famz/patchew,famz/patchew,famz/patchew,patchew-project/patchew,patchew-project/patchew,famz/patchew,patchew-project/patchew,patchew-project/patchew