perf(plugins): removes DB query to determine if a plugin is active

This also modernizes the plugin_id to object map to use a MemoryPool.

Fixes #7661
We usually assign all events in the global init function, but this seems better.