It was an illusion. To change the story so that that wasn't the case would take Loki too far out of character, IMO. I don't believe that Loki would ever truly sacrifice himself for Thor. Even if there was some amount of truth behind what he said to Thor as his "dying words," he was using the situation to his advantage, and clearly deceiving Thor. Loki actually sacrificing himself and being saved by Thanos, Hela, or Surtur takes away some of his potency as a master manipulator.