Prevent possible infinite loop when calling entity lifecyclecallbacks/listener methods which themselves modify the entity. (commit: 682db67)