Not disputing that there are always legal risks in whatever activity you do, but I think at least some of your worries in this case are somewhat covered.
> it was always infringing, but only now do you know that.
In my contract with the FSF it explicitly says "(to the extent known to Developer)".
> The free software code you wrote happens to be so related to your company's business interests that it falls within the scope of your employment, so the code is theirs.
They also send you a separate company disclaimer of rights which you can then let your company sign. You can keep that on file (or also send to the FSF) to show they were aware and approved of your actions.
> Also consider that you're indemnifying for any "alleged breach."
In the FSF contract I got it says "Developer is not obliged to defend FSF against any spurious claim of adverse ownership, but will cooperate with FSF in defending against any such claim"