fix possible double call to "beforeInitEvent.done()"

now surrounding beforeInitEvent notification with lockInit/releaseInit:
 - done() will be called as before (but with removed duplicate logic)
 - done() will not risk of being called twice (this actually happened when a beforeInitEvent trigger was locking and releasing the event fast)