improved write locking on task trees