[GEP-612] Search path dialog creates entry even if ESC is pressed

This commit ensures sane defaults (i.e. same as cancel) in case
the dialog shell is disposed for other reasons than a button press.
Pressing escape is one such reason.