Remove useless code: Do not try to rollback queries that do not make changes