Fix bug where we may not cancel one of the tasks in invokeAll with a timeout