NXP-10327: rely on dedicated flag to mark the task as ended instead of status as the status is exposed in public apis