Fixed #22802 -- Updated Atomic class to use transaction functions.

Changed Atomic class to make use of transaction-module-level API
functions instead of operating with connection directly, which allows
third-party libraries to more easily patch and customize transaction
management behavior and restores backwards-compatibility with
external libraries relying on this API.