The UN is a forum for leaders to come together to make agreements. Would you expect the world to resume construction of nuclear weapons (after first agreeing to stop producing them) simply because an act of terrorism or an act of war tore down a building? Or, is it reasonable to believe that previously-made agreements will remain intact when the forum for performing further negotiations gets taken out?
In the logic of the game, yes. Since the ability to create agreements only comes into existence by constructing the UN, destroying it should mean all the resolutions become void instantly.
I mean, in conceptual terms it doesn't even make sense that resolutions would be binding the way they are in-game. In real life leaders simply ignore the UN at will, it has no enforcement mechanism unless its member states are willing to go to war or provide 'peacekeepers.'
That said, while it's inconvenient, I don't find it unfair that previous agreements are enforced. Given that AIs won't raise Cities containing Wonders, it really is up to a player to decide to raze the City containing The UN.
I don't find it unfair, either, just conceptually stupid and immersion-ruining.
Lexicus said that the Defying Unhappiness went away for him:
As it turned out (replayed autosaves to test it) that was simply a coincidence. The unhappiness from defied resolutions expires as normal if you raze the UN; it just happened that the unhappiness expired the same turn I razed it.
An option when capturing the City with The UN inside of it, if you don't feel that you can hold onto the City, is to try to gift it to another AI. As long as your empire has the largest population in the world, doing so is one way to still be able to propose and alter resolutions.
To cancel a resolution, simply vote on the issue again and this time, vote No. However, note that AIs who are already in a Civic seem to highly favour voting for staying in that Civic (they might even always vote Yes, but there might also be exceptions to this possibility).
Well, actually you'd almost certainly need to put up the resolution for a vote again and then 'defy' it. I have seen AIs vote differently on the same resolution put up more than once (eg sometimes they will defy a civic resolution, sometimes not--not sure what makes them decide one way or the other)
Also, I haven't seen an AI propose a resolution that has already passed, so again, it is probably the player who has the choice to revote on a passed resolution.
I actually have seen the AI bring up passed resolutions. Two previously passed resolutions were brought up in a row (I was surprised too because before I saw this I didn't think the AI did it either).
It was a long time ago (not in the game the OP is talking about), it may be that the AI who re-voted the resolutions may not have been the same AI as the one who originally got them passed, but I can't remember now.
If you're set on razing The UN, try to do so before resolutions that you dislike get passed.
Well, I wasn't set on razing the UN until the first three resolutions brought for a vote were Global Civic-Environmentalism, Global Civic-Emancipation, and Global Civic-Emancipation

I would have defied the first vote, but I figured "I'll take the UN city and raze it and then I won't have to worry about it anymore".
Fortunately I defied the votes to get out of slavery anyway--couldn't afford any turns out of it, since I was whipping units every turn to deal with Mansa Musa's more advanced forces.
Anyway, the procedure these days is going to have to be defy everything, while getting set to raze the thing ASAP. Of course, most games I already have conquered enough territory (and capitulated enough AIs) by the time the UN is built that I become the Secretary General almost automatically.
That's rather a scary line of thinking. I'd rather believe that people and nations will remain true to their agreements and their word.
Well, to sustain such a belief requires ignoring most of human history. International law is violated with impunity by US presidents on a regular basis, let alone the more bloodthirsty world leaders (like, say, me playing a game of Civ

)
In game terms, though, I never gave my word! I voted 'no' on the resolution, and it's not like I ever agreed to abide by the terms of resolutions that were voted for by a majority of civs. I didn't sign any Atlantic Charter dammit!