Add dialog cancel listener

Need to clean up activity when user presses cancel, otherwise
the application hangs.