Optimization in KDE Base
ResourceWatcher: add *count() methods for resources, properties and types
These count methods are faster than returning the full list and then
counting the number of items in the list.
This also fixes an infinite loop where a temporary Resource is created
when querying for the number of resources being watched. The temporary
Resource is deleted, which results in ResourceData::resetAll being
callled which again called ResourceWatcher::resources(), and the cycle