SMWSql3SmwIds::getDatabaseIdAndSort raise exception for when smw_object_ids is inaccessible

- Use SMW\MediaWiki\Database instead of wfGetDB()