updated open/close routines & locking for HDF5.