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

closes #4504