BUG: fix writing of Categorical with to_sql (GH8624)

Use .get_values() instead of .values on the block,
this ensures that NonConsolidatable blocks (non-dense
blocks like categorical or sparse) are densified
instead of just returning the raw .values
Merge pull request #8682 from jorisvandenbossche/sql-8624-categorical

BUG: fix writing of Categorical with to_sql (GH8624)