Avoid PersistentCollection::isEmpty() to fully load the collection.

This is a suggested simple performance improvement for `PersistentCollection`.

At the moment, `isEmpty()` always fully loads the collection. By changing the code to rely on `count()`, which makes advantage of extra lazy fetch when the collection is not loaded, this saves the overhead of loading the entire collection when one just wants to check whether the collection is empty.