In the Pirc Defence there is actually two reasons why Black initiates a Queen trade. The obvious one is to remove White's Castling rights, but the more relevant one is that when an E5 Pawn is threatening the Knight, the Queen trade makes that White diagonal (g4 & h5) safe to put the f6 Knight on.
You never even considered that Kh5 move during the game but it was obvious it was the best move and it was even forced on you. I yelled but alas, you did not hear.