Task: fix abort() race condition