Fix the double loading of palettes.
This was initially an attempt to get the current palette to
deactivate if an associated document closes, but that doesn't
work yet. It however fixes the double loading of palettes when
loading a palette from an embedded source.