Fix logic for detecting cancellation.

Previous code did not return anything if user cancelled the warning
window. There was some useless exception handling instead. Now we just
test for return code: 0 means the window closed on its own; 1 means user
cancelled.