I am not a lawyer and you are probably right about creditors getting their money first. Maybe the following will explain better what Buffet bought.
Buffet bought Perpetual Preferred Stock with a 10% coupon. This stock is senior to Goldmans Preffered and Common Stock. This means he will be paid his 10% before any dividends are distributed to any shareholders. To sweaten the deal Golmans gave him a warrent for 5 years to buy an additional $5 billion in shares at $115.