fixes #520 - fixed two races in TaskTracker