Fixed #23792 -- Introduced  context manager to avoid random failure

Ticket https://code.djangoproject.com/ticket/23792, see http://djangoci.com/job/django-pull-requests/1528/database=postgres,python=python3.4/testReport/junit/django.contrib.formtools.tests.wizard.test_cookiestorage/TestCookieStorage/test_reset_cookie/