TRQ-2886 Improved thread protection when deleting multiple nodes.
Fixed a unit test.