TrkTrackSlimmingTool: Workaround for protected TrackStateOnSurface
To track down ATLASRECTS-6331, we want to write-protect TrackStateOnSurface objects held by a DataVector.
Unfortunately, TrackSlimmingTool in some cases casts away const from TSOS objects read from SG and modifies them. This will fail hard if the objects are write-protected.
Ultimately, we should just get rid of this workflow. But for now, work around by unprotecting memory before we change it, if needed, and then protect it again afterwards. We check before and after that the pointer in TSOS hasn't gotten trashed.
Temporary to try to track down ATLASRECTS-6331