Add safety check for unknown inventory items

When adding/removing features, without migration, there are sometimes
items (in the database) with IDs that are not valid anymore.

This fix makes it so that unknown items are simply ignored.