Now the dialogs use a copy of the ramp, and the edited
ramp is retrieved by calling ramp() on the dialog after
it is executed.
Avoids pointer lifetime issues by storing and working
on a ramp pointer which the dialog does not have ownership
on.
Also fix a bunch of leaks relating to cloning color ramps.