[TIMOB-13253] (3_1_X) Check for listeners before firing events

Cherry Pick PR #4240 into 3_1_X

Resolves [TIMOB-13253](https://jira.appcelerator.org/browse/TIMOB-13253)

This is a basic fix which I am comfortable backporting to 3_1_X. A more detailed PR which cleans up the eventing system will follow later. Will be attached to the eventing experiment ticket.