Store current confirm dialog as currentDialog, so it can be closed globally. Fixes #465