A few episodes later Hank and Gomez are killed and since this was a secret mission, no one else would have known about it.
Nope. Remember, there was another DEA officer (or similar) taking care of Huell. He didn't know about the case, but he did know that Hank and Gomez had kept Huell there.
I think it's pretty safe to say that Hank used official channels to get the safehouse setup. IIRC, these channels are designed in a manner such that there is a trail, but one that is very hard to track down (well, there has to be a trail, since government resources are being used up).
I bet that the death of Hank/Gomez is noticed by those in charge of the protection, and sooner or later a connection with the Heisenberg case is made. In which case the DEA would determine why Huell was kept in a safehouse, and take him into their custody (or free him) if they feel it prudent.
This is in fact reinforced by series creator Vince Gilligan himself in his book about Breaking Bad, as quoted in this entertainment weekly article:
Is Huell still waiting for someone to come back for him?
Yes, sadly he’s waiting morosely on that sofa, looking like a lost puppy… [Laughs] No. It’s likely that Agent Van Oster keeps in touch with DEA headquarters. So when he learns Gomez and Hank have gone missing, he would in short order tell his superiors what they were up to. Within a matter of hours, really not that many in story time, Huell will be taken back to HQ. They’ll question him, find out what he knows—which isn’t much—and he’ll be let out on the street. Right now, he’s doing what Huell does best, whatever that is. He’s out and about as a free man.