codeintel: Ensure we serialize all referenced result ids
Created by: efritz
We may prune all of the data from a result set, but still reference it. This causes the bundle manager to 500 when it can't find the wanted identifier.
This ensures that an empty result set is serialized. I'll have a cleanup PR later to address the todo. A longer-term solution is to remove all references from empty result sets, not to serialize them.