[1.5.x] Fixed #20075 -- Fixed session test fail when using a cache other than LocMemCache.

As override_settings was used after the initialization of the session backend,
we need to use a new session backend here.

Backport of 8c1cc4b3b0 from master