I would rule yes - but not because of the improvement to the CMD. If that's all Improved Grapple said then the answer would be no (there is no such thing as "CMD against escape" - it's CMD as passive defense and CMB to actively escape). But Improved Grapple also says:
In addition, you receive a +2 bonus on
checks made to grapple a foe.
I'd say that means a +2 to CMB whenever you're actively doing any of the grapple stuff. And "escape" is one of the grappling moves, even though it's to get away and the way the rule is stated has connotations of wanting to engage your foe.
No.
They get a free grapple check with a +4 bonus when you try to place them into a hazardous location. Not "so long as they're in a hazardous location and being grappled". Effectively, if they weren't in a specifically hazardous location before, and they will be after, then and only then do they get a free check. Moving them around while keeping them held them in a wall of fire is fine.
As such they certainly don't get a check every turn you move them anywhere above the ground. When do they get a check? It depends on what is accepted to be a "hazardous location".
Being carried off into the air is a hazardous location
This is fairly reasonable. Even if you're not actually going to take damage from falling, a mere 5 foot fall is likely to be inconvenient and possibly indirectly harmful (you could fall prone at the very least - that's a hazard). Regardless, being in the air arguably just hazardous because you're not supposed to be up there and can't move around normally or get down. Even if you don't buy this somewhat weak justification, doing it this way helps to avoid the weird corner cases of the second interpretation.
If this is true, then they get a free grapple check when you try to lift them off the ground. Specifically, when you move them 5 or more feet above the ground; moving them around less than 5 feet above the ground probably doesn't actually count as movement, even if that their feet are described as being off the ground due to your wrestling moves or whatever, because you can't move in less than 5-foot increments¹.
Being high enough above the ground to take falling damage is a hazardous location
This one is also fairly reasonable. If this is true, they get a free grapple check when you try to lift them high enough that you can cause them [falling] damage by letting go. By this logic, holding them over, say, a pool of acid would also grant them a free grapple check. It's just as hazardous a location as being held far above the ground, and for the same reason - they'll take damage when you drop them.
What if they won't take damage from certain falls? What if they have an extraordinary ability to reduce falling damge? Or what if they'll be falling 20 feet, but it's onto some very soft mushrooms that will cushion the landing and prevent all falling damage? They probably don't get a grapple check, but the rules are unclear.
Falling is a hazardous location
Under this interpretation, it doesn't matter how inconvenient or potentially dangerous the location is. Unless it is actually immediately² causing you damage, it's not hazardous. This also makes a certain amount of sense. They don't get a free check if while grappling you move them into a location where they're being flanked by a rogue, after all, even if that is arguably exposing them to a bunch of extra sneak attack damage.
If this is true, they get the free check when you let them go, regardless of how high you are flying (except they probably don't get a check at all if they're only 5 feet up and wouldn't be taking damage anyway). The issue with this (as mentioned in comments) is, well, this grapple check is only going to harm them. It's a free check to break the grapple. If they break the grapple, they fall anyway.
It also seems to contradict one of the examples given in the text ("when you place your foe in a hazardous location, such as [...] over a pit"), which strongly implies that it's one of the first two interpretations that are correct.
¹I don't know if this is explicitly stated anywhere.
²Meaning "before you get a turn"
Best Answer
There are no specific rules for edge cases like this. In Pathfinder the GM is expected to rule in a way that makes sense.
I find in cases like this, combining what's obviously realistic with a check leveraging even tangential RAW that at least nominally makes some of it under the control of the character is good.
The way I'd rule off the cuff if this was presented at a table:
Not "no," but not "you can do anything you want just because you asked" either.