If keys are drop-able (as I've seen suggested); just drop them in an unsafe container and forget about them.

(I didn't think they were drop-able though.)
I don't think you can drop keys, per se. But you CAN store them in a container, including corpses. The preferred method of using corpses is simply because they despawn the fastest, thus clearing them from the games memory/cache quicker.
Usually when this glitch happens, according to reports, increasing lag times will appear when trying to access the character's inventory, which is why you want to get them out of your inventory asap.