Testing if UIProgressMonitor is cancelled before executing