MULE-6874: Memory leak with dynamic endpoints

_Avoinding registering static endpoints created when resolving the dynamic endpoint for a given event
_NOTE: hard to add a test for this issue. Test the change using the app attached to the JIRA
(cherry picked from commit cd32a4e)
(cherry picked from commit b6e5004)