Fixed #21161 -- Timezone-related tests on Windows.

Thanks Xelnor for the patch.
Simplified a test by using CapturedQueriesContext
Fixed #18414 -- qs.exists() for sliced distinct queries
Fixed #21174 -- transaction control in related manager methods