Handle cancel/close in password dialog better