I still do that after years of treadmill exercising. I go every morning between 3.5 and 4.0 miles an hour at varying inclines. One explanation I have read is that the vasculature in your legs expands to feed the very large muscle groups and when you stop, blood tends to pool causing a reaction similar to orthostatic hypotension. If you posted this anywhere else, I would say don't be concerned. However, since you have a history of cardiac disease, you should really check with your doc. Even if my explanation is correct and it is just transient hypotension, he or she may want to know about it as stents like a certain pressure flowing through them. Or maybe it doesn't really matter. (I was the critical care nurse in my clinical days- who knows what happens to patients after they get discharged

But, it certainly is worth a phone call.
One option may be to get a referral to a cardiac rehab facility if only for a few days so that you can be monitored while you exercise. After they clear you, you can head back to the regular gym.
When I get off the treadmill (after a very dramatic cool down), I make it a point to not stand still for a few minutes. I wander through the house on the flat surface and may do one or two domestic chores that don't require standing. It has become habit to lift up on my toes and to tighten my thigh muscles when I first stand still to mechanically move the blood out of the tissues. Works for me.
Blood sugar, as Brad suggested, is also a possibility but it seldom self corrects without intervention and after all your hospitalizations, someone should have picked up on it by now.