Converted middleware tests to use RequestFactory.
Fixed #21255 -- Closed connections after management command ran

Thanks kabakov.as@gmail.com for the report, and Aymeric Augustin,
Simon Charette for the reviews.
Fixed #22279 -- Prevented dummy backend going through DatabaseErrorWrapper

Thanks Daniel Hahler for the report and Tim Graham for the review.
Fixed #23938 -- Added migration support for m2m to concrete fields and vice versa

Thanks to Michael D. Hoyle for the report and Tim Graham for the review.
Removed release note for refs #23938 as it couldn't be backported to 1.7.
Fixed breakage by 6fb9dee4 under Python2+Windows.

Refs #23271