[1.7.x] Fixed #23303 -- Added BEGIN and COMMIT statements to the output of sqlmigrate.

Backport of 5853c87a458f62ebd62d7809168355610de2570c from master.

Conflicts:
	django/core/management/commands/sqlmigrate.py
	tests/user_commands/tests.py