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
MDL-43736 Events: Updated unit test to test context not used in event