perf(annotations): increased performance of egef_annotations

The default behaviour of elgg_get_entities_from_annotations was
different from all other elgg_get_entities_from* functions.
This also caused a performance issue on large databases

Fixes #6638 

from #6787 
Todo:

- [x] rst docs for how to achieve the old behavior
- [x] add test for this specific case
- [x] resubmit to 1.10 branch