As far as I know, there is no way to fix putting the TMs and HMs in your Key Items pocket, but in your regular inventory, it's as simple as tossing them, as you would a normal item. From your TM pockets and Key Items though, I'd say you're stuck with them, since you can't toss or trade either category of item, and since you can't really overwrite the slots in any way with a different item, they'll likely stay there.