Transaction support enhancements:

1. Argument name changed: `$wrapWithTransaction` → `$transaction`.
2. Fixed bug with checking external transaction.
3. A bit shorter transaction handling code.
4. Thanks to @creocoder.