fix small memleak when importing
make colorpicker of tonecurve disappear immediately in the image after deactivation

put dt_control_queue_redraw() at a more reasonable position

(squashed into one to not leave the infinite loop as a separate commit)