TST: test_sql: properly drop tables with names that need to be quoted
Closes #10255 .

Rewrote some of the code in `test_sql.py` so that it now properly drops tables with names that need to be quoted.
