moved locking of commit stats into the task itself to remove race conditions when lock was not removed before starting another task.
moved locking of commit stats into the task itself to remove race conditions when lock was not removed before starting another task.