BUG: read_hdf was not respecting as passed mode (GH4504)

closes #4504