Fix event publication order in domain repository transactions