[bcl] Fix races in task tests.