Yes, you're correct. But (there's always a butt), if that contract causes the business to go under, the shareholder loses it's stake in the company. The reason the US didn't take full ownership is because the FED didn't want to show AIG's liabilities (estimates exceed $3 trillion) on it's balance sheet.
Anyways, a shareholder can't invalidate a contract just because they find the contract terms untenable. They invested in the company and as such, were also entered as a de facto party to the original contract. So, while you're correct in asserting that the US taxpayer isn't on the hook in a "legal" sense, for all practical purposes, they most certainly are.
And, I would add that I haven't specifically at the vehicle the US Fed used to invest in AIG - I should. But, I'm certain that the Fed DID NOT buy shares on the open market. Whatever process was used, I would guess that the agreement much more closely resembles an equity partnership rather than that of simple shareholder - FWIW.