BUG: Validate levels in a multi-index before storing in a HDFStore (GH5527)

close #5527