Wrapper HDS needs to remove some const

The previous commit synced up with the wrapper but some un-consting
had not previously been sent upstream. This reverses those changes.
Add primary/secondary status

This is done by first adding a simple boolean to the struct but
then also allowing the file handle to always be present in the
structure (which makes some other things useful later on).

For a primary locator the file handle is owned by the locator
and can be closed. For a secondary locator it is just a copy.

Still not able to demote a primary locator to a secondary because
there is not yet a way for the now secondary locator to get
hold of a standalone file id.
datMap will now check access permissions
Protect pointer access in test by checking status