Only load event managers if tagged event subscribers are found
merged branch hacfi/2.3_doctrine_compiler_pass (PR #8409)

This PR was submitted for the 2.3 branch but it was merged into the master branch instead (closes #8409).

Discussion
----------

[DoctrineBridge] Only load event managers if tagged event subscribers are found

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes

This PR only wraps the code that adds event subscribers / listeners in the Doctrine compiler pass RegisterEventListenersAndSubscribersPass so it doesn't run if no tagged services are found. So in general it doesn't change anything besides not running a few lines of code if it's not necessary. The reason I want this change is that it will allow DoctrinePHPCRBundle to be installed without Doctrine2 PHPCR ODM (I just want the PHPCR session..I don't need the ODM). This doesn't work currently as it tries to load the entity managers resulting in an error (Error: The service definition "doctrine_phpcr.odm.default_session.event_manager" does not exist.).

Commits
-------

63bc18c [DoctrineBridge] Only load event managers if tagged event subscribers are found