Fixed component counter synchronization in these cases:
* When deleting a component inside a collection.
* With the library published, when adding a new component in a collection and reverting library changes.
* With the library published, when deleting a component inside a collection and reverting library changes.
Also adds a published > num_counts field in collections in the search index.