view-model: Rename a variable for clarity
item-manager: Clean up add_item

Check if an item already exists for an ID / URN before creating it, and
do not leak the newly created item. There is no need to return the
item as it is not used.
view-model: Try to constrain the addition of new items

We want to show content in steps of N items, sorted by their mtime in
descending order. The value of N and the current offset is represented
by PhotosOffsetController. Normally, this works because these limits
are embedded in our SPARQL queries:
  "ORDER BY DESC (?mtime) LIMIT 50 OFFSET 100"

However, when reacting to "graph-updated" signals we were adding items
to PhotosViewModel without validating the constraints. As an extreme
example, when the application is started with a clean DB a large
number of nmm:Photo objects are added by the miners. We end up
displaying a huge number of items in the GtkIconView and chewing 100%
CPU.

We should do better.

For starters, let us not add new items to the model if:
 - The number of rows in the model is equal to the sum of the current
   step and offset, AND
 - The item is older than the oldest item currently in the model

We could still have more rows in the model than stipulated by the
current step and offset if the item being added is recent enough. If
the current filtering proves to be insufficient then we can look into
removing older rows from the model as newer ones are added.

Also, update the count in PhotosOffsetController whenever a new item
is added so that things like the the "Load More" button works
correctly.

Fixes: https://bugzilla.gnome.org/721402