[1.6.x] Fixed an encoding issue in the test client.

Refs #20530.

Backport of 7bb62793 and 476b0764 from master.

Conflicts:
	django/test/client.py
[1.6.x] Fixed #20530 -- Properly decoded non-ASCII query strings on Python 3.

Thanks mitsuhiko for the report.

Backport of 65b6eff3 and adaptation of 8aaca65 from master.