Fixed issue with thread blocking when cancelling first task in iterator