They are getting bonuses because of the loans. The issue whether they are getting the money directly out of the loans or not is impossible to decide because once the bank gets the money it treats it like any other money.
But if the loans did not exist, many of these people would not be getting these bonuses either because their employers would not exist either, or because their employers would not have sufficient capital to generate the profits from which the bonuses come.
No, it's not impossible, they've paid back the loans, so it's not coming out of that money, period. Goldman in particular:
a) didn't want the money, they were forced to take it
b) paid it back as soon as they were allowed
So yes, they would have gotten those bonuses regardless, and no, you can't say they would have failed without it.
This has been covered million time before, but even though Goldman repaid the tarp loans, they are still getting loans through the fed since they decided to buy a consumer bank for that exact purpose.
Also, the bailout of AIG was really a bailout of Goldman. In other words, AIG got bailed out so that they could pay Goldman their enormous losses on securities that they bought from Goldman.