MDL-43736 Events: event->contextinstanceid should be used where possible

While restoring event context might not be present (deleted)
So before using context api's check context or use event properties