hds-v5: Two fixes from GAIA testing

+ Correctly handle leading and trailing space when adding the
  .sdf extension.
+ Can now use datCopy on a root locator.
hdstools: Allow hcopy to copy within a single file

Same as recent change to Figaro COPOBJ. New HDF can not open
a file read/write that is already open for read.