entitlement: optimize EventsStreamBuilder

Speed it up by limiting the amount of database calls.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>