Once you have temporary hit points, it doesn't matter how you got them: if a cleric gave them to you and the cleric dies, you keep your THP. If you got them from an item and you lose the item, you keep your THP. If the DM granted you THP for doing something cool and the DM dies... well probably you should call an ambulance or something, but you've still got those THP.

However, from the Rules Compendium p259:

Temporary Hit Points

Until a Rest: A creature's temporary hit points last until they're reduced to 0 or until the creature takes a short or extended rest.

So you can use the Staff of Resilience before a fight, stow it, and switch to a more combat-oriented staff and still keep your THP, but the THP will disappear if you take a rest.