purge_history: handle sqlite asshattery
purge_history: handle sqlite asshattery

apparently creating a temporary table commits the transaction. because that's a
useful thing.

matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse