A few things to dig into, here.
The first is that I think there's a pretty huge distinction between having something on display in a museum, with relevant context, vs giving it as a gift (particularly to a child).
I'm not one of those who suggested disposing of the dolls (I'd return to SIL) but equally I'm not sure there are a huge range of options beyond that. The ones pictured in the OP do not appear rare, so I'm not sure a museum would be interested (and, of course, gollywogs are still made and sold).
If the SIL refused to accept them back, I wouldn't have any particular issue with OP disposing of them - nobody is obliged to keep anything in their home that they don't want, after all.
I also think there's a question of remoteness: few (if any) of the things you have listed are likely to be considered offensive on their face, even if they are linked to dubious historical ideas or events. A gollywog, on the other hand, even if you are unware of their history and the additional baggage that goes with it, is a racist characture and is easily recognizable as such (at least, to adults). In that sense, they're more obviously and immediately offensive than even a swastika.
Finally, racism remains a present, real-world issue, including in the UK, and not one that is confined to the history books.