The problem obviously is that you can't easily split the files back to two pngs
Maybe, but you can even less easily write a routine which safely handles unknown attributes in the icOn chunk. String attributes are embedded in the taglist instead of pointers/offsets and if for an unknown attribute (added/invented in future) you don't know how to decide whether it's a string attribute or not, you are screwed.