Fix db test in _set_database

The isset($this->db) will always return false in a model as it's a $CI property, then the database will be loaded for each model.