Merge pull request #2378 in HDFFV/hdf5 from ~DYOUNG/werror:dont-crash-on-close to develop
* commit '093c2c7e69bc4a40e9d49eece1d6fdcf54e8ecb0':
Avoid a crash, don't check if we're flushing when the file is closing: there's no need to check if the metadata cache is flushing if we already know the file is closing, because the condition we rely on is "closing OR flushing." Further, the cache may have already gone away, so sometimes calling into the cache to see if it's flushing will crash the program.