Fixed a concurrently array modification error while rearranging the dock hierarchy during an undock