HDR import: fix error messages appearing when dialog is canceled by user

Thanks to @audioglider for catching this.