BUG: fix writing of Categorical with to_sql (GH8624)

Closes #8624 

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.