Fixed incorrect datatype conversion on multi-indexes

When creating a new table from a `pandas` dataframe with a multi-index, the code would iterate over the index columns backwards but use their types as if counting forwards.  This meant that the created table had incorrect indexes for multi-indexes.

This code factors out a function to pull column names and column types for both SQLAlchemy and legacy table objects.  This code now iterates over the indices properly.

And additional test has been written.  All test pass on my local machine.

Closes https://github.com/pydata/pandas/issues/8021 .
I think you can put this in `_TestSQLApi` instead of `TestSQLiteAlchemy`, as this is not really specific (or will not differ) between flavors. And in this way it is also tested for the fallback mode (legacy). There is eg a `test_to_sql_index_label_multiindex`, you can put it after that one.