I'm not sure how that could happen. We have the source code, if they renege on the agreement then we just go do something else with it and sue them if they continue to use it.
Sure. Most of what you lose is opportunity cost, time, bureaucratic overhead, and the possibility that they just take your code and go.
Yes, you could sue them. This is harder than it sounds, especially if they're optimizing to be sued -- companies that are out to screw people often optimize to be sued, roughly speaking.
Again, not saying "OMG! This must be pure evil!". Just, y'know, you sound awfully confident that nothing can go wrong and I don't think that's justified in this case.
No one's saying you're going to get screwed. Some people are saying you should take care not to be, and they're right.