fix local variable ref before assignment

if the oadrEvent payload is empty and the for loop executes zero times, updated_events will be undefined when it's referenced as an argument for the event_callback. This exception is caught by the try/catch that wraps the call to the callback, and an "error in event callback" is raised before the callback is executed.

I just moved the variable init out of the for loop for now.