queries: make temporary table name unique

Since we don't quite have support for ON COMMIT yet in SQLAlchemy, make
sure we don't get collision with tables by giving temporary tables a
unique uuid-based name.