When leaving the darkroom do not loose history items.

If some history are selected (for comparing with a snapshot for example) we
do not want to loose history above the selected point when leaving the
darkroom.

This adds some safety.