unlock task mutex asap in add_task