Lock the DataItem RWLock while generating the ADS tree for the dock.

The ADS is now generating a node tree that describes the state
of the ADS when queried. This in turn queries the workspace itself
and while running in MantidPlot an executing script can cause
things wrapped in a cow_ptr to be copied and at the same time
access the pointer while it is being copied, causing a crash.

Refs #7583
Merge branch 'bugfix/7583_crash_on_dock_updating' into develop