fixes logout problem for view-restricted pages

added test for 66639bce69
improvements according to https://github.com/divio/django-cms/pull/2044