Attempt to fix MID-2125 (concurrency issues when interrupting tasks).