...gh5 winning the exchange. White has not developed his kingside pieces. So the time it will take to get them active gives you more than enough time to prepare for any kind of attacks against your weakened pawn structure.
White has 2 pieces "attacking" your kingside. You have 5 pieces defending your kingside. Simple math. You take the rook winning the exchange. Now white has 1 piece on your kingside while you still have 5. Math...its a wonderful thing :-)
I was black, up two pawns, better developed, queens off the board. I had a choice between trading bishops or winning the exchange. But taking the rook meant wrecking king safety. I choose to trade bishops and maintain king safety, especially the dark squares around my king.
But surely there are times when foregoing king safety leads to a winning position. Say, queens are on the board, no rooks, and you can capture a queen for a bishop. I know it'll depend on pieces left, pawn cover, etc..., but when do you sacrifice safety for material advantage?