Replaced manual savepoints by atomic blocks.

This ensures the rollback flag is handled consistently in internal APIs.
Prevented running queries in transactions that will be rolled back.

This avoids a counter-intuitive behavior in an edge case on databases
with non-atomic transaction semantics.

It prevents using savepoint_rollback() inside an atomic block without
calling set_rollback(False) first, which is backwards-incompatible in
tests.

Refs #21134.
Allowed nesting constraint_checks_disabled inside atomic.

Since MySQL handles transactions loosely, this isn't a problem.
Fixed TransactionManagementError in tests.

Previous commit introduced an additional check to prevent running
queries in transactions that will be rolled back, which triggered a few
failures in the tests. In practice using transaction.atomic instead of
the low-level savepoint APIs was enough to fix the problems.